(function webpackUniversalModuleDefinition(root, factory) {
	if(typeof exports === 'object' && typeof module === 'object')
		module.exports = factory(require("babylonjs"));
	else if(typeof define === 'function' && define.amd)
		define("babylonjs-gui", ["babylonjs"], factory);
	else if(typeof exports === 'object')
		exports["babylonjs-gui"] = factory(require("babylonjs"));
	else
		root["BABYLON"] = root["BABYLON"] || {}, root["BABYLON"]["GUI"] = factory(root["BABYLON"]);
})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_core_Misc_observable__) {
return /******/ (() => { // webpackBootstrap
/******/ 	"use strict";
/******/ 	var __webpack_modules__ = ({

/***/ "../../../../node_modules/tslib/tslib.es6.js":
/*!***************************************************!*\
  !*** ../../../../node_modules/tslib/tslib.es6.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "__assign": () => (/* binding */ __assign),
/* harmony export */   "__asyncDelegator": () => (/* binding */ __asyncDelegator),
/* harmony export */   "__asyncGenerator": () => (/* binding */ __asyncGenerator),
/* harmony export */   "__asyncValues": () => (/* binding */ __asyncValues),
/* harmony export */   "__await": () => (/* binding */ __await),
/* harmony export */   "__awaiter": () => (/* binding */ __awaiter),
/* harmony export */   "__classPrivateFieldGet": () => (/* binding */ __classPrivateFieldGet),
/* harmony export */   "__classPrivateFieldSet": () => (/* binding */ __classPrivateFieldSet),
/* harmony export */   "__createBinding": () => (/* binding */ __createBinding),
/* harmony export */   "__decorate": () => (/* binding */ __decorate),
/* harmony export */   "__exportStar": () => (/* binding */ __exportStar),
/* harmony export */   "__extends": () => (/* binding */ __extends),
/* harmony export */   "__generator": () => (/* binding */ __generator),
/* harmony export */   "__importDefault": () => (/* binding */ __importDefault),
/* harmony export */   "__importStar": () => (/* binding */ __importStar),
/* harmony export */   "__makeTemplateObject": () => (/* binding */ __makeTemplateObject),
/* harmony export */   "__metadata": () => (/* binding */ __metadata),
/* harmony export */   "__param": () => (/* binding */ __param),
/* harmony export */   "__read": () => (/* binding */ __read),
/* harmony export */   "__rest": () => (/* binding */ __rest),
/* harmony export */   "__spread": () => (/* binding */ __spread),
/* harmony export */   "__spreadArray": () => (/* binding */ __spreadArray),
/* harmony export */   "__spreadArrays": () => (/* binding */ __spreadArrays),
/* harmony export */   "__values": () => (/* binding */ __values)
/* harmony export */ });
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise */

var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
    return extendStatics(d, b);
};

function __extends(d, b) {
    if (typeof b !== "function" && b !== null)
        throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}

var __assign = function() {
    __assign = Object.assign || function __assign(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
        }
        return t;
    }
    return __assign.apply(this, arguments);
}

function __rest(s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
}

function __decorate(decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
}

function __param(paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
}

function __metadata(metadataKey, metadataValue) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
}

function __awaiter(thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
}

function __generator(thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
}

var __createBinding = Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
});

function __exportStar(m, o) {
    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
}

function __values(o) {
    var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
    if (m) return m.call(o);
    if (o && typeof o.length === "number") return {
        next: function () {
            if (o && i >= o.length) o = void 0;
            return { value: o && o[i++], done: !o };
        }
    };
    throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}

function __read(o, n) {
    var m = typeof Symbol === "function" && o[Symbol.iterator];
    if (!m) return o;
    var i = m.call(o), r, ar = [], e;
    try {
        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
    }
    catch (error) { e = { error: error }; }
    finally {
        try {
            if (r && !r.done && (m = i["return"])) m.call(i);
        }
        finally { if (e) throw e.error; }
    }
    return ar;
}

/** @deprecated */
function __spread() {
    for (var ar = [], i = 0; i < arguments.length; i++)
        ar = ar.concat(__read(arguments[i]));
    return ar;
}

/** @deprecated */
function __spreadArrays() {
    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
    for (var r = Array(s), k = 0, i = 0; i < il; i++)
        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
            r[k] = a[j];
    return r;
}

function __spreadArray(to, from, pack) {
    if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
        if (ar || !(i in from)) {
            if (!ar) ar = Array.prototype.slice.call(from, 0, i);
            ar[i] = from[i];
        }
    }
    return to.concat(ar || Array.prototype.slice.call(from));
}

function __await(v) {
    return this instanceof __await ? (this.v = v, this) : new __await(v);
}

function __asyncGenerator(thisArg, _arguments, generator) {
    if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
    var g = generator.apply(thisArg, _arguments || []), i, q = [];
    return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
    function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
    function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
    function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
    function fulfill(value) { resume("next", value); }
    function reject(value) { resume("throw", value); }
    function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
}

function __asyncDelegator(o) {
    var i, p;
    return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
    function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
}

function __asyncValues(o) {
    if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
    var m = o[Symbol.asyncIterator], i;
    return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
    function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
    function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
}

function __makeTemplateObject(cooked, raw) {
    if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
    return cooked;
};

var __setModuleDefault = Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
};

function __importStar(mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
}

function __importDefault(mod) {
    return (mod && mod.__esModule) ? mod : { default: mod };
}

function __classPrivateFieldGet(receiver, state, kind, f) {
    if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
    if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
    return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
}

function __classPrivateFieldSet(receiver, state, value, kind, f) {
    if (kind === "m") throw new TypeError("Private method is not writable");
    if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
    if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
    return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
}


/***/ }),

/***/ "../../../lts/gui/dist/2D/adtInstrumentation.js":
/*!******************************************************!*\
  !*** ../../../lts/gui/dist/2D/adtInstrumentation.js ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "AdvancedDynamicTextureInstrumentation": () => (/* binding */ AdvancedDynamicTextureInstrumentation)
/* harmony export */ });
/* harmony import */ var core_Misc_perfCounter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Misc/perfCounter */ "core/Misc/observable");
/* harmony import */ var core_Misc_perfCounter__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_Misc_perfCounter__WEBPACK_IMPORTED_MODULE_0__);

/**
 * This class can be used to get instrumentation data from a AdvancedDynamicTexture object
 */
var AdvancedDynamicTextureInstrumentation = /** @class */ (function () {
    /**
     * Instantiates a new advanced dynamic texture instrumentation.
     * This class can be used to get instrumentation data from an AdvancedDynamicTexture object
     * @param texture Defines the AdvancedDynamicTexture to instrument
     */
    function AdvancedDynamicTextureInstrumentation(
    /**
     * Define the instrumented AdvancedDynamicTexture.
     */
    texture) {
        this.texture = texture;
        this._captureRenderTime = false;
        this._renderTime = new core_Misc_perfCounter__WEBPACK_IMPORTED_MODULE_0__.PerfCounter();
        this._captureLayoutTime = false;
        this._layoutTime = new core_Misc_perfCounter__WEBPACK_IMPORTED_MODULE_0__.PerfCounter();
        // Observers
        this._onBeginRenderObserver = null;
        this._onEndRenderObserver = null;
        this._onBeginLayoutObserver = null;
        this._onEndLayoutObserver = null;
    }
    Object.defineProperty(AdvancedDynamicTextureInstrumentation.prototype, "renderTimeCounter", {
        // Properties
        /**
         * Gets the perf counter used to capture render time
         */
        get: function () {
            return this._renderTime;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AdvancedDynamicTextureInstrumentation.prototype, "layoutTimeCounter", {
        /**
         * Gets the perf counter used to capture layout time
         */
        get: function () {
            return this._layoutTime;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AdvancedDynamicTextureInstrumentation.prototype, "captureRenderTime", {
        /**
         * Enable or disable the render time capture
         */
        get: function () {
            return this._captureRenderTime;
        },
        set: function (value) {
            var _this = this;
            if (value === this._captureRenderTime) {
                return;
            }
            this._captureRenderTime = value;
            if (value) {
                this._onBeginRenderObserver = this.texture.onBeginRenderObservable.add(function () {
                    _this._renderTime.beginMonitoring();
                });
                this._onEndRenderObserver = this.texture.onEndRenderObservable.add(function () {
                    _this._renderTime.endMonitoring(true);
                });
            }
            else {
                this.texture.onBeginRenderObservable.remove(this._onBeginRenderObserver);
                this._onBeginRenderObserver = null;
                this.texture.onEndRenderObservable.remove(this._onEndRenderObserver);
                this._onEndRenderObserver = null;
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AdvancedDynamicTextureInstrumentation.prototype, "captureLayoutTime", {
        /**
         * Enable or disable the layout time capture
         */
        get: function () {
            return this._captureLayoutTime;
        },
        set: function (value) {
            var _this = this;
            if (value === this._captureLayoutTime) {
                return;
            }
            this._captureLayoutTime = value;
            if (value) {
                this._onBeginLayoutObserver = this.texture.onBeginLayoutObservable.add(function () {
                    _this._layoutTime.beginMonitoring();
                });
                this._onEndLayoutObserver = this.texture.onEndLayoutObservable.add(function () {
                    _this._layoutTime.endMonitoring(true);
                });
            }
            else {
                this.texture.onBeginLayoutObservable.remove(this._onBeginLayoutObserver);
                this._onBeginLayoutObserver = null;
                this.texture.onEndLayoutObservable.remove(this._onEndLayoutObserver);
                this._onEndLayoutObserver = null;
            }
        },
        enumerable: false,
        configurable: true
    });
    /**
     * Dispose and release associated resources.
     */
    AdvancedDynamicTextureInstrumentation.prototype.dispose = function () {
        this.texture.onBeginRenderObservable.remove(this._onBeginRenderObserver);
        this._onBeginRenderObserver = null;
        this.texture.onEndRenderObservable.remove(this._onEndRenderObserver);
        this._onEndRenderObserver = null;
        this.texture.onBeginLayoutObservable.remove(this._onBeginLayoutObserver);
        this._onBeginLayoutObserver = null;
        this.texture.onEndLayoutObservable.remove(this._onEndLayoutObserver);
        this._onEndLayoutObserver = null;
        this.texture = null;
    };
    return AdvancedDynamicTextureInstrumentation;
}());



/***/ }),

/***/ "../../../lts/gui/dist/2D/advancedDynamicTexture.js":
/*!**********************************************************!*\
  !*** ../../../lts/gui/dist/2D/advancedDynamicTexture.js ***!
  \**********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "AdvancedDynamicTexture": () => (/* binding */ AdvancedDynamicTexture)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Misc/typeStore */ "core/Misc/observable");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _controls_container__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./controls/container */ "../../../lts/gui/dist/2D/controls/container.js");
/* harmony import */ var _controls_control__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./controls/control */ "../../../lts/gui/dist/2D/controls/control.js");
/* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./style */ "../../../lts/gui/dist/2D/style.js");
/* harmony import */ var _measure__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./measure */ "../../../lts/gui/dist/2D/measure.js");




















/**
 * Class used to create texture to support 2D GUI elements
 * @see https://doc.babylonjs.com/how_to/gui
 */
var AdvancedDynamicTexture = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(AdvancedDynamicTexture, _super);
    /**
     * Creates a new AdvancedDynamicTexture
     * @param name defines the name of the texture
     * @param width defines the width of the texture
     * @param height defines the height of the texture
     * @param scene defines the hosting scene
     * @param generateMipMaps defines a boolean indicating if mipmaps must be generated (false by default)
     * @param samplingMode defines the texture sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
     * @param invertY defines if the texture needs to be inverted on the y axis during loading (true by default)
     */
    function AdvancedDynamicTexture(name, width, height, scene, generateMipMaps, samplingMode, invertY) {
        if (width === void 0) { width = 0; }
        if (height === void 0) { height = 0; }
        if (generateMipMaps === void 0) { generateMipMaps = false; }
        if (samplingMode === void 0) { samplingMode = core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Texture.NEAREST_SAMPLINGMODE; }
        if (invertY === void 0) { invertY = true; }
        var _this = _super.call(this, name, { width: width, height: height }, scene, generateMipMaps, samplingMode, core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Constants.TEXTUREFORMAT_RGBA, invertY) || this;
        _this._isDirty = false;
        /** @hidden */
        _this._rootContainer = new _controls_container__WEBPACK_IMPORTED_MODULE_2__.Container("root");
        /** @hidden */
        _this._lastControlOver = {};
        /** @hidden */
        _this._lastControlDown = {};
        /** @hidden */
        _this._capturingControl = {};
        /** @hidden */
        _this._linkedControls = new Array();
        _this._isFullscreen = false;
        _this._fullscreenViewport = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Viewport(0, 0, 1, 1);
        _this._idealWidth = 0;
        _this._idealHeight = 0;
        _this._useSmallestIdeal = false;
        _this._renderAtIdealSize = false;
        _this._blockNextFocusCheck = false;
        _this._renderScale = 1;
        _this._cursorChanged = false;
        _this._defaultMousePointerId = 0;
        /** @hidden */
        _this._numLayoutCalls = 0;
        /** @hidden */
        _this._numRenderCalls = 0;
        /**
         * Define type to string to ensure compatibility across browsers
         * Safari doesn't support DataTransfer constructor
         */
        _this._clipboardData = "";
        /**
         * Observable event triggered each time an clipboard event is received from the rendering canvas
         */
        _this.onClipboardObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        /**
         * Observable event triggered each time a pointer down is intercepted by a control
         */
        _this.onControlPickedObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        /**
         * Observable event triggered before layout is evaluated
         */
        _this.onBeginLayoutObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        /**
         * Observable event triggered after the layout was evaluated
         */
        _this.onEndLayoutObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        /**
         * Observable event triggered before the texture is rendered
         */
        _this.onBeginRenderObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        /**
         * Observable event triggered after the texture was rendered
         */
        _this.onEndRenderObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        /**
         * Gets or sets a boolean defining if alpha is stored as premultiplied
         */
        _this.premulAlpha = false;
        /**
         * Gets or sets a boolean indicating that the canvas must be reverted on Y when updating the texture
         */
        _this.applyYInversionOnUpdate = true;
        /**
         * If set to true, every scene render will trigger a pointer event for the GUI
         * if it is linked to a mesh or has controls linked to a mesh. This will allow
         * you to catch the pointer moving around the GUI due to camera or mesh movements,
         * but it has a performance cost.
         */
        _this.checkPointerEveryFrame = false;
        _this._useInvalidateRectOptimization = true;
        // Invalidated rectangle which is the combination of all invalidated controls after they have been rotated into absolute position
        _this._invalidatedRectangle = null;
        _this._clearMeasure = new _measure__WEBPACK_IMPORTED_MODULE_5__.Measure(0, 0, 0, 0);
        /**
         * @param rawEvt
         * @hidden
         */
        _this._onClipboardCopy = function (rawEvt) {
            var evt = rawEvt;
            var ev = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.ClipboardInfo(core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.ClipboardEventTypes.COPY, evt);
            _this.onClipboardObservable.notifyObservers(ev);
            evt.preventDefault();
        };
        /**
         * @param rawEvt
         * @hidden
         */
        _this._onClipboardCut = function (rawEvt) {
            var evt = rawEvt;
            var ev = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.ClipboardInfo(core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.ClipboardEventTypes.CUT, evt);
            _this.onClipboardObservable.notifyObservers(ev);
            evt.preventDefault();
        };
        /**
         * @param rawEvt
         * @hidden
         */
        _this._onClipboardPaste = function (rawEvt) {
            var evt = rawEvt;
            var ev = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.ClipboardInfo(core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.ClipboardEventTypes.PASTE, evt);
            _this.onClipboardObservable.notifyObservers(ev);
            evt.preventDefault();
        };
        scene = _this.getScene();
        if (!scene || !_this._texture) {
            return _this;
        }
        _this.applyYInversionOnUpdate = invertY;
        _this._rootElement = scene.getEngine().getInputElement();
        _this._renderObserver = scene.onBeforeCameraRenderObservable.add(function (camera) { return _this._checkUpdate(camera); });
        _this._preKeyboardObserver = scene.onPreKeyboardObservable.add(function (info) {
            if (!_this._focusedControl) {
                return;
            }
            if (info.type === core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.KeyboardEventTypes.KEYDOWN) {
                _this._focusedControl.processKeyboard(info.event);
            }
            info.skipOnPointerObservable = true;
        });
        _this._rootContainer._link(_this);
        _this.hasAlpha = true;
        if (!width || !height) {
            _this._resizeObserver = scene.getEngine().onResizeObservable.add(function () { return _this._onResize(); });
            _this._onResize();
        }
        _this._texture.isReady = true;
        return _this;
    }
    Object.defineProperty(AdvancedDynamicTexture.prototype, "numLayoutCalls", {
        /** Gets the number of layout calls made the last time the ADT has been rendered */
        get: function () {
            return this._numLayoutCalls;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AdvancedDynamicTexture.prototype, "numRenderCalls", {
        /** Gets the number of render calls made the last time the ADT has been rendered */
        get: function () {
            return this._numRenderCalls;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AdvancedDynamicTexture.prototype, "renderScale", {
        /**
         * Gets or sets a number used to scale rendering size (2 means that the texture will be twice bigger).
         * Useful when you want more antialiasing
         */
        get: function () {
            return this._renderScale;
        },
        set: function (value) {
            if (value === this._renderScale) {
                return;
            }
            this._renderScale = value;
            this._onResize();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AdvancedDynamicTexture.prototype, "background", {
        /** Gets or sets the background color */
        get: function () {
            return this._background;
        },
        set: function (value) {
            if (this._background === value) {
                return;
            }
            this._background = value;
            this.markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AdvancedDynamicTexture.prototype, "idealWidth", {
        /**
         * Gets or sets the ideal width used to design controls.
         * The GUI will then rescale everything accordingly
         * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
         */
        get: function () {
            return this._idealWidth;
        },
        set: function (value) {
            if (this._idealWidth === value) {
                return;
            }
            this._idealWidth = value;
            this.markAsDirty();
            this._rootContainer._markAllAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AdvancedDynamicTexture.prototype, "idealHeight", {
        /**
         * Gets or sets the ideal height used to design controls.
         * The GUI will then rescale everything accordingly
         * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
         */
        get: function () {
            return this._idealHeight;
        },
        set: function (value) {
            if (this._idealHeight === value) {
                return;
            }
            this._idealHeight = value;
            this.markAsDirty();
            this._rootContainer._markAllAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AdvancedDynamicTexture.prototype, "useSmallestIdeal", {
        /**
         * Gets or sets a boolean indicating if the smallest ideal value must be used if idealWidth and idealHeight are both set
         * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
         */
        get: function () {
            return this._useSmallestIdeal;
        },
        set: function (value) {
            if (this._useSmallestIdeal === value) {
                return;
            }
            this._useSmallestIdeal = value;
            this.markAsDirty();
            this._rootContainer._markAllAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AdvancedDynamicTexture.prototype, "renderAtIdealSize", {
        /**
         * Gets or sets a boolean indicating if adaptive scaling must be used
         * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
         */
        get: function () {
            return this._renderAtIdealSize;
        },
        set: function (value) {
            if (this._renderAtIdealSize === value) {
                return;
            }
            this._renderAtIdealSize = value;
            this._onResize();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AdvancedDynamicTexture.prototype, "idealRatio", {
        /**
         * Gets the ratio used when in "ideal mode"
         * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
         * */
        get: function () {
            var rwidth = 0;
            var rheight = 0;
            if (this._idealWidth) {
                rwidth = this.getSize().width / this._idealWidth;
            }
            if (this._idealHeight) {
                rheight = this.getSize().height / this._idealHeight;
            }
            if (this._useSmallestIdeal && this._idealWidth && this._idealHeight) {
                return window.innerWidth < window.innerHeight ? rwidth : rheight;
            }
            if (this._idealWidth) {
                // horizontal
                return rwidth;
            }
            if (this._idealHeight) {
                // vertical
                return rheight;
            }
            return 1;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AdvancedDynamicTexture.prototype, "layer", {
        /**
         * Gets the underlying layer used to render the texture when in fullscreen mode
         */
        get: function () {
            return this._layerToDispose;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AdvancedDynamicTexture.prototype, "rootContainer", {
        /**
         * Gets the root container control
         */
        get: function () {
            return this._rootContainer;
        },
        enumerable: false,
        configurable: true
    });
    /**
     * Returns an array containing the root container.
     * This is mostly used to let the Inspector introspects the ADT
     * @returns an array containing the rootContainer
     */
    AdvancedDynamicTexture.prototype.getChildren = function () {
        return [this._rootContainer];
    };
    /**
     * Will return all controls that are inside this texture
     * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
     * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
     * @return all child controls
     */
    AdvancedDynamicTexture.prototype.getDescendants = function (directDescendantsOnly, predicate) {
        return this._rootContainer.getDescendants(directDescendantsOnly, predicate);
    };
    /**
     * Will return all controls with the given type name
     * @param typeName defines the type name to search for
     * @returns an array of all controls found
     */
    AdvancedDynamicTexture.prototype.getControlsByType = function (typeName) {
        return this._rootContainer.getDescendants(false, function (control) { return control.typeName === typeName; });
    };
    /**
     * Will return the first control with the given name
     * @param name defines the name to search for
     * @return the first control found or null
     */
    AdvancedDynamicTexture.prototype.getControlByName = function (name) {
        return this._getControlByKey("name", name);
    };
    AdvancedDynamicTexture.prototype._getControlByKey = function (key, value) {
        return this._rootContainer.getDescendants().find(function (control) { return control[key] === value; }) || null;
    };
    Object.defineProperty(AdvancedDynamicTexture.prototype, "focusedControl", {
        /**
         * Gets or sets the current focused control
         */
        get: function () {
            return this._focusedControl;
        },
        set: function (control) {
            if (this._focusedControl == control) {
                return;
            }
            if (this._focusedControl) {
                this._focusedControl.onBlur();
            }
            if (control) {
                control.onFocus();
            }
            this._focusedControl = control;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AdvancedDynamicTexture.prototype, "isForeground", {
        /**
         * Gets or sets a boolean indicating if the texture must be rendered in background or foreground when in fullscreen mode
         */
        get: function () {
            if (!this.layer) {
                return true;
            }
            return !this.layer.isBackground;
        },
        set: function (value) {
            if (!this.layer) {
                return;
            }
            if (this.layer.isBackground === !value) {
                return;
            }
            this.layer.isBackground = !value;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AdvancedDynamicTexture.prototype, "clipboardData", {
        /**
         * Gets or set information about clipboardData
         */
        get: function () {
            return this._clipboardData;
        },
        set: function (value) {
            this._clipboardData = value;
        },
        enumerable: false,
        configurable: true
    });
    /**
     * Get the current class name of the texture useful for serialization or dynamic coding.
     * @returns "AdvancedDynamicTexture"
     */
    AdvancedDynamicTexture.prototype.getClassName = function () {
        return "AdvancedDynamicTexture";
    };
    /**
     * Function used to execute a function on all controls
     * @param func defines the function to execute
     * @param container defines the container where controls belong. If null the root container will be used
     */
    AdvancedDynamicTexture.prototype.executeOnAllControls = function (func, container) {
        if (!container) {
            container = this._rootContainer;
        }
        func(container);
        for (var _i = 0, _a = container.children; _i < _a.length; _i++) {
            var child = _a[_i];
            if (child.children) {
                this.executeOnAllControls(func, child);
                continue;
            }
            func(child);
        }
    };
    Object.defineProperty(AdvancedDynamicTexture.prototype, "useInvalidateRectOptimization", {
        /**
         * Gets or sets a boolean indicating if the InvalidateRect optimization should be turned on
         */
        get: function () {
            return this._useInvalidateRectOptimization;
        },
        set: function (value) {
            this._useInvalidateRectOptimization = value;
        },
        enumerable: false,
        configurable: true
    });
    /**
     * Invalidates a rectangle area on the gui texture
     * @param invalidMinX left most position of the rectangle to invalidate in the texture
     * @param invalidMinY top most position of the rectangle to invalidate in the texture
     * @param invalidMaxX right most position of the rectangle to invalidate in the texture
     * @param invalidMaxY bottom most position of the rectangle to invalidate in the texture
     */
    AdvancedDynamicTexture.prototype.invalidateRect = function (invalidMinX, invalidMinY, invalidMaxX, invalidMaxY) {
        if (!this._useInvalidateRectOptimization) {
            return;
        }
        if (!this._invalidatedRectangle) {
            this._invalidatedRectangle = new _measure__WEBPACK_IMPORTED_MODULE_5__.Measure(invalidMinX, invalidMinY, invalidMaxX - invalidMinX + 1, invalidMaxY - invalidMinY + 1);
        }
        else {
            // Compute intersection
            var maxX = Math.ceil(Math.max(this._invalidatedRectangle.left + this._invalidatedRectangle.width - 1, invalidMaxX));
            var maxY = Math.ceil(Math.max(this._invalidatedRectangle.top + this._invalidatedRectangle.height - 1, invalidMaxY));
            this._invalidatedRectangle.left = Math.floor(Math.min(this._invalidatedRectangle.left, invalidMinX));
            this._invalidatedRectangle.top = Math.floor(Math.min(this._invalidatedRectangle.top, invalidMinY));
            this._invalidatedRectangle.width = maxX - this._invalidatedRectangle.left + 1;
            this._invalidatedRectangle.height = maxY - this._invalidatedRectangle.top + 1;
        }
    };
    /**
     * Marks the texture as dirty forcing a complete update
     */
    AdvancedDynamicTexture.prototype.markAsDirty = function () {
        this._isDirty = true;
    };
    /**
     * Helper function used to create a new style
     * @returns a new style
     * @see https://doc.babylonjs.com/how_to/gui#styles
     */
    AdvancedDynamicTexture.prototype.createStyle = function () {
        return new _style__WEBPACK_IMPORTED_MODULE_4__.Style(this);
    };
    /**
     * Adds a new control to the root container
     * @param control defines the control to add
     * @returns the current texture
     */
    AdvancedDynamicTexture.prototype.addControl = function (control) {
        this._rootContainer.addControl(control);
        return this;
    };
    /**
     * Removes a control from the root container
     * @param control defines the control to remove
     * @returns the current texture
     */
    AdvancedDynamicTexture.prototype.removeControl = function (control) {
        this._rootContainer.removeControl(control);
        return this;
    };
    /**
     * Moves overlapped controls towards a position where it is not overlapping anymore.
     * Please note that this method alters linkOffsetXInPixels and linkOffsetYInPixels.
     * @param overlapGroup the overlap group which will be processed or undefined to process all overlap groups
     * @param deltaStep the step size (speed) to reach the target non overlapping position (default 0.1)
     * @param repelFactor how much is the control repelled by other controls
     */
    AdvancedDynamicTexture.prototype.moveToNonOverlappedPosition = function (overlapGroup, deltaStep, repelFactor) {
        if (deltaStep === void 0) { deltaStep = 1; }
        if (repelFactor === void 0) { repelFactor = 1; }
        var controlsForGroup;
        if (Array.isArray(overlapGroup)) {
            controlsForGroup = overlapGroup;
        }
        else {
            var descendants = this.getDescendants(true);
            // get only the controls with an overlapGroup property set
            // if the overlapGroup parameter is set, filter the controls and get only the controls belonging to that overlapGroup
            controlsForGroup = overlapGroup === undefined ? descendants.filter(function (c) { return c.overlapGroup !== undefined; }) : descendants.filter(function (c) { return c.overlapGroup === overlapGroup; });
        }
        controlsForGroup.forEach(function (control1) {
            var _a;
            var velocity = core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Vector2.Zero();
            var center = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Vector2(control1.centerX, control1.centerY);
            controlsForGroup.forEach(function (control2) {
                if (control1 !== control2 && AdvancedDynamicTexture._Overlaps(control1, control2)) {
                    // if the two controls overlaps get a direction vector from one control's center to another control's center
                    var diff = center.subtract(new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Vector2(control2.centerX, control2.centerY));
                    var diffLength = diff.length();
                    if (diffLength > 0) {
                        // calculate the velocity
                        velocity = velocity.add(diff.normalize().scale(repelFactor / diffLength));
                    }
                }
            });
            if (velocity.length() > 0) {
                // move the control along the direction vector away from the overlapping control
                velocity = velocity.normalize().scale(deltaStep * ((_a = control1.overlapDeltaMultiplier) !== null && _a !== void 0 ? _a : 1));
                control1.linkOffsetXInPixels += velocity.x;
                control1.linkOffsetYInPixels += velocity.y;
            }
        });
    };
    /**
     * Release all resources
     */
    AdvancedDynamicTexture.prototype.dispose = function () {
        var scene = this.getScene();
        if (!scene) {
            return;
        }
        this._rootElement = null;
        scene.onBeforeCameraRenderObservable.remove(this._renderObserver);
        if (this._resizeObserver) {
            scene.getEngine().onResizeObservable.remove(this._resizeObserver);
        }
        if (this._pointerMoveObserver) {
            scene.onPrePointerObservable.remove(this._pointerMoveObserver);
        }
        if (this._sceneRenderObserver) {
            scene.onBeforeRenderObservable.remove(this._sceneRenderObserver);
        }
        if (this._pointerObserver) {
            scene.onPointerObservable.remove(this._pointerObserver);
        }
        if (this._preKeyboardObserver) {
            scene.onPreKeyboardObservable.remove(this._preKeyboardObserver);
        }
        if (this._canvasPointerOutObserver) {
            scene.getEngine().onCanvasPointerOutObservable.remove(this._canvasPointerOutObserver);
        }
        if (this._canvasBlurObserver) {
            scene.getEngine().onCanvasBlurObservable.remove(this._canvasBlurObserver);
        }
        if (this._layerToDispose) {
            this._layerToDispose.texture = null;
            this._layerToDispose.dispose();
            this._layerToDispose = null;
        }
        this._rootContainer.dispose();
        this.onClipboardObservable.clear();
        this.onControlPickedObservable.clear();
        this.onBeginRenderObservable.clear();
        this.onEndRenderObservable.clear();
        this.onBeginLayoutObservable.clear();
        this.onEndLayoutObservable.clear();
        _super.prototype.dispose.call(this);
    };
    AdvancedDynamicTexture.prototype._onResize = function () {
        var scene = this.getScene();
        if (!scene) {
            return;
        }
        // Check size
        var engine = scene.getEngine();
        var textureSize = this.getSize();
        var renderWidth = engine.getRenderWidth() * this._renderScale;
        var renderHeight = engine.getRenderHeight() * this._renderScale;
        if (this._renderAtIdealSize) {
            if (this._idealWidth) {
                renderHeight = (renderHeight * this._idealWidth) / renderWidth;
                renderWidth = this._idealWidth;
            }
            else if (this._idealHeight) {
                renderWidth = (renderWidth * this._idealHeight) / renderHeight;
                renderHeight = this._idealHeight;
            }
        }
        if (textureSize.width !== renderWidth || textureSize.height !== renderHeight) {
            this.scaleTo(renderWidth, renderHeight);
            this.markAsDirty();
            if (this._idealWidth || this._idealHeight) {
                this._rootContainer._markAllAsDirty();
            }
        }
        this.invalidateRect(0, 0, textureSize.width - 1, textureSize.height - 1);
    };
    /** @hidden */
    AdvancedDynamicTexture.prototype._getGlobalViewport = function () {
        var size = this.getSize();
        var globalViewPort = this._fullscreenViewport.toGlobal(size.width, size.height);
        var targetX = Math.round(globalViewPort.width * (1 / this.rootContainer.scaleX));
        var targetY = Math.round(globalViewPort.height * (1 / this.rootContainer.scaleY));
        globalViewPort.x += (globalViewPort.width - targetX) / 2;
        globalViewPort.y += (globalViewPort.height - targetY) / 2;
        globalViewPort.width = targetX;
        globalViewPort.height = targetY;
        return globalViewPort;
    };
    /**
     * Get screen coordinates for a vector3
     * @param position defines the position to project
     * @param worldMatrix defines the world matrix to use
     * @returns the projected position
     */
    AdvancedDynamicTexture.prototype.getProjectedPosition = function (position, worldMatrix) {
        var result = this.getProjectedPositionWithZ(position, worldMatrix);
        return new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Vector2(result.x, result.y);
    };
    /**
     * Get screen coordinates for a vector3
     * @param position defines the position to project
     * @param worldMatrix defines the world matrix to use
     * @returns the projected position with Z
     */
    AdvancedDynamicTexture.prototype.getProjectedPositionWithZ = function (position, worldMatrix) {
        var scene = this.getScene();
        if (!scene) {
            return core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Vector3.Zero();
        }
        var globalViewport = this._getGlobalViewport();
        var projectedPosition = core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Vector3.Project(position, worldMatrix, scene.getTransformMatrix(), globalViewport);
        return new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Vector3(projectedPosition.x, projectedPosition.y, projectedPosition.z);
    };
    AdvancedDynamicTexture.prototype._checkUpdate = function (camera) {
        if (this._layerToDispose) {
            if ((camera.layerMask & this._layerToDispose.layerMask) === 0) {
                return;
            }
        }
        if (this._isFullscreen && this._linkedControls.length) {
            var scene = this.getScene();
            if (!scene) {
                return;
            }
            var globalViewport = this._getGlobalViewport();
            var _loop_1 = function (control) {
                if (!control.isVisible) {
                    return "continue";
                }
                var mesh = control._linkedMesh;
                if (!mesh || mesh.isDisposed()) {
                    core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Tools.SetImmediate(function () {
                        control.linkWithMesh(null);
                    });
                    return "continue";
                }
                var position = mesh.getBoundingInfo ? mesh.getBoundingInfo().boundingSphere.center : core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Vector3.ZeroReadOnly;
                var projectedPosition = core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Vector3.Project(position, mesh.getWorldMatrix(), scene.getTransformMatrix(), globalViewport);
                if (projectedPosition.z < 0 || projectedPosition.z > 1) {
                    control.notRenderable = true;
                    return "continue";
                }
                control.notRenderable = false;
                control._moveToProjectedPosition(projectedPosition);
            };
            for (var _i = 0, _a = this._linkedControls; _i < _a.length; _i++) {
                var control = _a[_i];
                _loop_1(control);
            }
        }
        if (!this._isDirty && !this._rootContainer.isDirty) {
            return;
        }
        this._isDirty = false;
        this._render();
        this.update(this.applyYInversionOnUpdate, this.premulAlpha, AdvancedDynamicTexture.AllowGPUOptimizations);
    };
    AdvancedDynamicTexture.prototype._render = function () {
        var textureSize = this.getSize();
        var renderWidth = textureSize.width;
        var renderHeight = textureSize.height;
        var context = this.getContext();
        context.font = "18px Arial";
        context.strokeStyle = "white";
        // Layout
        this.onBeginLayoutObservable.notifyObservers(this);
        var measure = new _measure__WEBPACK_IMPORTED_MODULE_5__.Measure(0, 0, renderWidth, renderHeight);
        this._numLayoutCalls = 0;
        this._rootContainer._layout(measure, context);
        this.onEndLayoutObservable.notifyObservers(this);
        this._isDirty = false; // Restoring the dirty state that could have been set by controls during layout processing
        // Clear
        if (this._invalidatedRectangle) {
            this._clearMeasure.copyFrom(this._invalidatedRectangle);
        }
        else {
            this._clearMeasure.copyFromFloats(0, 0, renderWidth, renderHeight);
        }
        context.clearRect(this._clearMeasure.left, this._clearMeasure.top, this._clearMeasure.width, this._clearMeasure.height);
        if (this._background) {
            context.save();
            context.fillStyle = this._background;
            context.fillRect(this._clearMeasure.left, this._clearMeasure.top, this._clearMeasure.width, this._clearMeasure.height);
            context.restore();
        }
        // Render
        this.onBeginRenderObservable.notifyObservers(this);
        this._numRenderCalls = 0;
        this._rootContainer._render(context, this._invalidatedRectangle);
        this.onEndRenderObservable.notifyObservers(this);
        this._invalidatedRectangle = null;
    };
    /**
     * @param cursor
     * @hidden
     */
    AdvancedDynamicTexture.prototype._changeCursor = function (cursor) {
        if (this._rootElement) {
            this._rootElement.style.cursor = cursor;
            this._cursorChanged = true;
        }
    };
    /**
     * @param control
     * @param pointerId
     * @hidden
     */
    AdvancedDynamicTexture.prototype._registerLastControlDown = function (control, pointerId) {
        this._lastControlDown[pointerId] = control;
        this.onControlPickedObservable.notifyObservers(control);
    };
    AdvancedDynamicTexture.prototype._doPicking = function (x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY) {
        var scene = this.getScene();
        if (!scene) {
            return;
        }
        var engine = scene.getEngine();
        var textureSize = this.getSize();
        if (this._isFullscreen) {
            var camera = scene.cameraToUseForPointers || scene.activeCamera;
            if (!camera) {
                return;
            }
            var viewport = camera.viewport;
            x = x * (textureSize.width / (engine.getRenderWidth() * viewport.width));
            y = y * (textureSize.height / (engine.getRenderHeight() * viewport.height));
        }
        if (this._capturingControl[pointerId]) {
            this._capturingControl[pointerId]._processObservables(type, x, y, pi, pointerId, buttonIndex);
            return;
        }
        this._cursorChanged = false;
        if (!this._rootContainer._processPicking(x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY)) {
            if (!scene.doNotHandleCursors) {
                this._changeCursor("");
            }
            if (type === core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PointerEventTypes.POINTERMOVE) {
                if (this._lastControlOver[pointerId]) {
                    this._lastControlOver[pointerId]._onPointerOut(this._lastControlOver[pointerId], pi);
                    delete this._lastControlOver[pointerId];
                }
            }
        }
        if (!this._cursorChanged && !scene.doNotHandleCursors) {
            this._changeCursor("");
        }
        this._manageFocus();
    };
    /**
     * @param list
     * @param control
     * @hidden
     */
    AdvancedDynamicTexture.prototype._cleanControlAfterRemovalFromList = function (list, control) {
        for (var pointerId in list) {
            if (!Object.prototype.hasOwnProperty.call(list, pointerId)) {
                continue;
            }
            var lastControlOver = list[pointerId];
            if (lastControlOver === control) {
                delete list[pointerId];
            }
        }
    };
    /**
     * @param control
     * @hidden
     */
    AdvancedDynamicTexture.prototype._cleanControlAfterRemoval = function (control) {
        this._cleanControlAfterRemovalFromList(this._lastControlDown, control);
        this._cleanControlAfterRemovalFromList(this._lastControlOver, control);
    };
    AdvancedDynamicTexture.prototype._translateToPicking = function (scene, tempViewport, pi) {
        var camera = scene.cameraToUseForPointers || scene.activeCamera;
        var engine = scene.getEngine();
        var originalCameraToUseForPointers = scene.cameraToUseForPointers;
        if (!camera) {
            tempViewport.x = 0;
            tempViewport.y = 0;
            tempViewport.width = engine.getRenderWidth();
            tempViewport.height = engine.getRenderHeight();
        }
        else {
            if (camera.rigCameras.length) {
                // rig camera - we need to find the camera to use for this event
                var rigViewport_1 = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Viewport(0, 0, 1, 1);
                camera.rigCameras.forEach(function (rigCamera) {
                    // generate the viewport of this camera
                    rigCamera.viewport.toGlobalToRef(engine.getRenderWidth(), engine.getRenderHeight(), rigViewport_1);
                    var x = scene.pointerX / engine.getHardwareScalingLevel() - rigViewport_1.x;
                    var y = scene.pointerY / engine.getHardwareScalingLevel() - (engine.getRenderHeight() - rigViewport_1.y - rigViewport_1.height);
                    // check if the pointer is in the camera's viewport
                    if (x < 0 || y < 0 || x > rigViewport_1.width || y > rigViewport_1.height) {
                        // out of viewport - don't use this camera
                        return;
                    }
                    // set the camera to use for pointers until this pointer loop is over
                    scene.cameraToUseForPointers = rigCamera;
                    // set the viewport
                    tempViewport.x = rigViewport_1.x;
                    tempViewport.y = rigViewport_1.y;
                    tempViewport.width = rigViewport_1.width;
                    tempViewport.height = rigViewport_1.height;
                });
            }
            else {
                camera.viewport.toGlobalToRef(engine.getRenderWidth(), engine.getRenderHeight(), tempViewport);
            }
        }
        var x = scene.pointerX / engine.getHardwareScalingLevel() - tempViewport.x;
        var y = scene.pointerY / engine.getHardwareScalingLevel() - (engine.getRenderHeight() - tempViewport.y - tempViewport.height);
        this._shouldBlockPointer = false;
        // Do picking modifies _shouldBlockPointer
        if (pi) {
            var pointerId = pi.event.pointerId || this._defaultMousePointerId;
            this._doPicking(x, y, pi, pi.type, pointerId, pi.event.button, pi.event.deltaX, pi.event.deltaY);
            // Avoid overwriting a true skipOnPointerObservable to false
            if (this._shouldBlockPointer || this._capturingControl[pointerId]) {
                pi.skipOnPointerObservable = true;
            }
        }
        else {
            this._doPicking(x, y, null, core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PointerEventTypes.POINTERMOVE, this._defaultMousePointerId, 0);
        }
        // if overridden by a rig camera - reset back to the original value
        scene.cameraToUseForPointers = originalCameraToUseForPointers;
    };
    /** Attach to all scene events required to support pointer events */
    AdvancedDynamicTexture.prototype.attach = function () {
        var _this = this;
        var scene = this.getScene();
        if (!scene) {
            return;
        }
        var tempViewport = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Viewport(0, 0, 0, 0);
        this._pointerMoveObserver = scene.onPrePointerObservable.add(function (pi) {
            if (scene.isPointerCaptured(pi.event.pointerId)) {
                return;
            }
            if (pi.type !== core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PointerEventTypes.POINTERMOVE &&
                pi.type !== core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PointerEventTypes.POINTERUP &&
                pi.type !== core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PointerEventTypes.POINTERDOWN &&
                pi.type !== core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PointerEventTypes.POINTERWHEEL) {
                return;
            }
            if (pi.type === core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PointerEventTypes.POINTERMOVE && pi.event.pointerId) {
                _this._defaultMousePointerId = pi.event.pointerId; // This is required to make sure we have the correct pointer ID for wheel
            }
            _this._translateToPicking(scene, tempViewport, pi);
        });
        this._attachPickingToSceneRender(scene, function () { return _this._translateToPicking(scene, tempViewport, null); }, false);
        this._attachToOnPointerOut(scene);
        this._attachToOnBlur(scene);
    };
    /**
     * Register the clipboard Events onto the canvas
     */
    AdvancedDynamicTexture.prototype.registerClipboardEvents = function () {
        self.addEventListener("copy", this._onClipboardCopy, false);
        self.addEventListener("cut", this._onClipboardCut, false);
        self.addEventListener("paste", this._onClipboardPaste, false);
    };
    /**
     * Unregister the clipboard Events from the canvas
     */
    AdvancedDynamicTexture.prototype.unRegisterClipboardEvents = function () {
        self.removeEventListener("copy", this._onClipboardCopy);
        self.removeEventListener("cut", this._onClipboardCut);
        self.removeEventListener("paste", this._onClipboardPaste);
    };
    /**
     * Connect the texture to a hosting mesh to enable interactions
     * @param mesh defines the mesh to attach to
     * @param supportPointerMove defines a boolean indicating if pointer move events must be catched as well
     */
    AdvancedDynamicTexture.prototype.attachToMesh = function (mesh, supportPointerMove) {
        var _this = this;
        if (supportPointerMove === void 0) { supportPointerMove = true; }
        var scene = this.getScene();
        if (!scene) {
            return;
        }
        this._pointerObserver = scene.onPointerObservable.add(function (pi) {
            if (pi.type !== core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PointerEventTypes.POINTERMOVE &&
                pi.type !== core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PointerEventTypes.POINTERUP &&
                pi.type !== core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PointerEventTypes.POINTERDOWN &&
                pi.type !== core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PointerEventTypes.POINTERWHEEL) {
                return;
            }
            if (pi.type === core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PointerEventTypes.POINTERMOVE && pi.event.pointerId) {
                _this._defaultMousePointerId = pi.event.pointerId; // This is required to make sure we have the correct pointer ID for wheel
            }
            var pointerId = pi.event.pointerId || _this._defaultMousePointerId;
            if (pi.pickInfo && pi.pickInfo.hit && pi.pickInfo.pickedMesh === mesh) {
                var uv = pi.pickInfo.getTextureCoordinates();
                if (uv) {
                    var size = _this.getSize();
                    _this._doPicking(uv.x * size.width, (_this.applyYInversionOnUpdate ? 1.0 - uv.y : uv.y) * size.height, pi, pi.type, pointerId, pi.event.button, pi.event.deltaX, pi.event.deltaY);
                }
            }
            else if (pi.type === core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PointerEventTypes.POINTERUP) {
                if (_this._lastControlDown[pointerId]) {
                    _this._lastControlDown[pointerId]._forcePointerUp(pointerId);
                }
                delete _this._lastControlDown[pointerId];
                if (_this.focusedControl) {
                    var friendlyControls = _this.focusedControl.keepsFocusWith();
                    var canMoveFocus = true;
                    if (friendlyControls) {
                        for (var _i = 0, friendlyControls_1 = friendlyControls; _i < friendlyControls_1.length; _i++) {
                            var control = friendlyControls_1[_i];
                            // Same host, no need to keep the focus
                            if (_this === control._host) {
                                continue;
                            }
                            // Different hosts
                            var otherHost = control._host;
                            if (otherHost._lastControlOver[pointerId] && otherHost._lastControlOver[pointerId].isAscendant(control)) {
                                canMoveFocus = false;
                                break;
                            }
                        }
                    }
                    if (canMoveFocus) {
                        _this.focusedControl = null;
                    }
                }
            }
            else if (pi.type === core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PointerEventTypes.POINTERMOVE) {
                if (_this._lastControlOver[pointerId]) {
                    _this._lastControlOver[pointerId]._onPointerOut(_this._lastControlOver[pointerId], pi, true);
                }
                delete _this._lastControlOver[pointerId];
            }
        });
        mesh.enablePointerMoveEvents = supportPointerMove;
        this._attachPickingToSceneRender(scene, function () {
            var pointerId = _this._defaultMousePointerId;
            var pick = scene === null || scene === void 0 ? void 0 : scene.pick(scene.pointerX, scene.pointerY);
            if (pick && pick.hit && pick.pickedMesh === mesh) {
                var uv = pick.getTextureCoordinates();
                if (uv) {
                    var size = _this.getSize();
                    _this._doPicking(uv.x * size.width, (_this.applyYInversionOnUpdate ? 1.0 - uv.y : uv.y) * size.height, null, core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PointerEventTypes.POINTERMOVE, pointerId, 0);
                }
            }
            else {
                if (_this._lastControlOver[pointerId]) {
                    _this._lastControlOver[pointerId]._onPointerOut(_this._lastControlOver[pointerId], null, true);
                }
                delete _this._lastControlOver[pointerId];
            }
        }, true);
        this._attachToOnPointerOut(scene);
        this._attachToOnBlur(scene);
    };
    /**
     * Move the focus to a specific control
     * @param control defines the control which will receive the focus
     */
    AdvancedDynamicTexture.prototype.moveFocusToControl = function (control) {
        this.focusedControl = control;
        this._lastPickedControl = control;
        this._blockNextFocusCheck = true;
    };
    AdvancedDynamicTexture.prototype._manageFocus = function () {
        if (this._blockNextFocusCheck) {
            this._blockNextFocusCheck = false;
            this._lastPickedControl = this._focusedControl;
            return;
        }
        // Focus management
        if (this._focusedControl) {
            if (this._focusedControl !== this._lastPickedControl) {
                if (this._lastPickedControl.isFocusInvisible) {
                    return;
                }
                this.focusedControl = null;
            }
        }
    };
    AdvancedDynamicTexture.prototype._attachPickingToSceneRender = function (scene, pickFunction, forcePicking) {
        var _this = this;
        this._sceneRenderObserver = scene.onBeforeRenderObservable.add(function () {
            if (!_this.checkPointerEveryFrame) {
                return;
            }
            if (_this._linkedControls.length > 0 || forcePicking) {
                pickFunction();
            }
        });
    };
    AdvancedDynamicTexture.prototype._attachToOnPointerOut = function (scene) {
        var _this = this;
        this._canvasPointerOutObserver = scene.getEngine().onCanvasPointerOutObservable.add(function (pointerEvent) {
            if (_this._lastControlOver[pointerEvent.pointerId]) {
                _this._lastControlOver[pointerEvent.pointerId]._onPointerOut(_this._lastControlOver[pointerEvent.pointerId], null);
            }
            delete _this._lastControlOver[pointerEvent.pointerId];
            if (_this._lastControlDown[pointerEvent.pointerId] && _this._lastControlDown[pointerEvent.pointerId] !== _this._capturingControl[pointerEvent.pointerId]) {
                _this._lastControlDown[pointerEvent.pointerId]._forcePointerUp();
                delete _this._lastControlDown[pointerEvent.pointerId];
            }
        });
    };
    AdvancedDynamicTexture.prototype._attachToOnBlur = function (scene) {
        var _this = this;
        this._canvasBlurObserver = scene.getEngine().onCanvasBlurObservable.add(function () {
            Object.entries(_this._lastControlDown).forEach(function (_a) {
                var value = _a[1];
                value._onCanvasBlur();
            });
            _this.focusedControl = null;
            _this._lastControlDown = {};
        });
    };
    /**
     * Serializes the entire GUI system
     * @returns an object with the JSON serialized data
     */
    AdvancedDynamicTexture.prototype.serializeContent = function () {
        var size = this.getSize();
        var serializationObject = {
            root: {},
            width: size.width,
            height: size.height,
        };
        this._rootContainer.serialize(serializationObject.root);
        return serializationObject;
    };
    /**
     * Recreate the content of the ADT from a JSON object
     * @param serializedObject define the JSON serialized object to restore from
     * @param scaleToSize defines whether to scale to texture to the saved size
     */
    AdvancedDynamicTexture.prototype.parseContent = function (serializedObject, scaleToSize) {
        this._rootContainer = _controls_control__WEBPACK_IMPORTED_MODULE_3__.Control.Parse(serializedObject.root, this);
        if (scaleToSize) {
            var width = serializedObject.width;
            var height = serializedObject.height;
            if (typeof width === "number" && typeof height === "number" && width >= 0 && height >= 0) {
                this.scaleTo(width, height);
            }
            else {
                // scales the GUI to a default size if none was available in the serialized content
                this.scaleTo(1920, 1080);
            }
        }
    };
    /**
     * Recreate the content of the ADT from a snippet saved by the GUI editor
     * @param snippetId defines the snippet to load
     * @param scaleToSize defines whether to scale to texture to the saved size
     * @returns a promise that will resolve on success
     */
    AdvancedDynamicTexture.prototype.parseFromSnippetAsync = function (snippetId, scaleToSize) {
        var _this = this;
        if (snippetId === "_BLANK") {
            return Promise.resolve();
        }
        return new Promise(function (resolve, reject) {
            var request = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.WebRequest();
            request.addEventListener("readystatechange", function () {
                if (request.readyState == 4) {
                    if (request.status == 200) {
                        var snippet = JSON.parse(JSON.parse(request.responseText).jsonPayload);
                        var serializationObject = JSON.parse(snippet.gui);
                        _this.parseContent(serializationObject, scaleToSize);
                        _this.snippetId = snippetId;
                        resolve();
                    }
                    else {
                        reject("Unable to load the snippet " + snippetId);
                    }
                }
            });
            request.open("GET", AdvancedDynamicTexture.SnippetUrl + "/" + snippetId.replace(/#/g, "/"));
            request.send();
        });
    };
    /**
     * Recreate the content of the ADT from a url json
     * @param url defines the url to load
     * @param scaleToSize defines whether to scale to texture to the saved size
     * @returns a promise that will resolve on success
     */
    AdvancedDynamicTexture.prototype.parseFromURLAsync = function (url, scaleToSize) {
        var _this = this;
        if (url === "") {
            return Promise.resolve();
        }
        return new Promise(function (resolve, reject) {
            var request = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.WebRequest();
            request.addEventListener("readystatechange", function () {
                if (request.readyState == 4) {
                    if (request.status == 200) {
                        var gui = request.responseText;
                        var serializationObject = JSON.parse(gui);
                        _this.parseContent(serializationObject, scaleToSize);
                        resolve();
                    }
                    else {
                        reject("Unable to load");
                    }
                }
            });
            request.open("GET", url);
            request.send();
        });
    };
    // Statics
    /**
     * Compares two rectangle based controls for pixel overlap
     * @param control1 The first control to compare
     * @param control2 The second control to compare
     * @returns true if overlaps, otherwise false
     */
    AdvancedDynamicTexture._Overlaps = function (control1, control2) {
        return !(control1.centerX > control2.centerX + control2.widthInPixels ||
            control1.centerX + control1.widthInPixels < control2.centerX ||
            control1.centerY + control1.heightInPixels < control2.centerY ||
            control1.centerY > control2.centerY + control2.heightInPixels);
    };
    /**
     * Creates a new AdvancedDynamicTexture in projected mode (ie. attached to a mesh)
     * @param mesh defines the mesh which will receive the texture
     * @param width defines the texture width (1024 by default)
     * @param height defines the texture height (1024 by default)
     * @param supportPointerMove defines a boolean indicating if the texture must capture move events (true by default)
     * @param onlyAlphaTesting defines a boolean indicating that alpha blending will not be used (only alpha testing) (false by default)
     * @param invertY defines if the texture needs to be inverted on the y axis during loading (true by default)
     * @param materialSetupCallback defines a custom way of creating and setting up the material on the mesh
     * @returns a new AdvancedDynamicTexture
     */
    AdvancedDynamicTexture.CreateForMesh = function (mesh, width, height, supportPointerMove, onlyAlphaTesting, invertY, materialSetupCallback) {
        if (width === void 0) { width = 1024; }
        if (height === void 0) { height = 1024; }
        if (supportPointerMove === void 0) { supportPointerMove = true; }
        if (onlyAlphaTesting === void 0) { onlyAlphaTesting = false; }
        if (materialSetupCallback === void 0) { materialSetupCallback = this._CreateMaterial; }
        // use a unique ID in name so serialization will work even if you create two ADTs for a single mesh
        var uniqueId = (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.RandomGUID)();
        var result = new AdvancedDynamicTexture("AdvancedDynamicTexture for ".concat(mesh.name, " [").concat(uniqueId, "]"), width, height, mesh.getScene(), true, core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Texture.TRILINEAR_SAMPLINGMODE, invertY);
        materialSetupCallback(mesh, uniqueId, result, onlyAlphaTesting);
        result.attachToMesh(mesh, supportPointerMove);
        return result;
    };
    AdvancedDynamicTexture._CreateMaterial = function (mesh, uniqueId, texture, onlyAlphaTesting) {
        var internalClassType = (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.GetClass)("BABYLON.StandardMaterial");
        if (!internalClassType) {
            throw "StandardMaterial needs to be imported before as it contains a side-effect required by your code.";
        }
        var material = new internalClassType("AdvancedDynamicTextureMaterial for ".concat(mesh.name, " [").concat(uniqueId, "]"), mesh.getScene());
        material.backFaceCulling = false;
        material.diffuseColor = core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Color3.Black();
        material.specularColor = core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Color3.Black();
        if (onlyAlphaTesting) {
            material.diffuseTexture = texture;
            material.emissiveTexture = texture;
            texture.hasAlpha = true;
        }
        else {
            material.emissiveTexture = texture;
            material.opacityTexture = texture;
        }
        mesh.material = material;
    };
    /**
     * Creates a new AdvancedDynamicTexture in projected mode (ie. attached to a mesh) BUT do not create a new material for the mesh. You will be responsible for connecting the texture
     * @param mesh defines the mesh which will receive the texture
     * @param width defines the texture width (1024 by default)
     * @param height defines the texture height (1024 by default)
     * @param supportPointerMove defines a boolean indicating if the texture must capture move events (true by default)
     * @param invertY defines if the texture needs to be inverted on the y axis during loading (true by default)
     * @returns a new AdvancedDynamicTexture
     */
    AdvancedDynamicTexture.CreateForMeshTexture = function (mesh, width, height, supportPointerMove, invertY) {
        if (width === void 0) { width = 1024; }
        if (height === void 0) { height = 1024; }
        if (supportPointerMove === void 0) { supportPointerMove = true; }
        var result = new AdvancedDynamicTexture(mesh.name + " AdvancedDynamicTexture", width, height, mesh.getScene(), true, core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Texture.TRILINEAR_SAMPLINGMODE, invertY);
        result.attachToMesh(mesh, supportPointerMove);
        return result;
    };
    /**
     * Creates a new AdvancedDynamicTexture in fullscreen mode.
     * In this mode the texture will rely on a layer for its rendering.
     * This allows it to be treated like any other layer.
     * As such, if you have a multi camera setup, you can set the layerMask on the GUI as well.
     * LayerMask is set through advancedTexture.layer.layerMask
     * @param name defines name for the texture
     * @param foreground defines a boolean indicating if the texture must be rendered in foreground (default is true)
     * @param scene defines the hosting scene
     * @param sampling defines the texture sampling mode (Texture.BILINEAR_SAMPLINGMODE by default)
     * @param adaptiveScaling defines whether to automatically scale root to match hardwarescaling (false by default)
     * @returns a new AdvancedDynamicTexture
     */
    AdvancedDynamicTexture.CreateFullscreenUI = function (name, foreground, scene, sampling, adaptiveScaling) {
        if (foreground === void 0) { foreground = true; }
        if (scene === void 0) { scene = null; }
        if (sampling === void 0) { sampling = core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Texture.BILINEAR_SAMPLINGMODE; }
        if (adaptiveScaling === void 0) { adaptiveScaling = false; }
        var result = new AdvancedDynamicTexture(name, 0, 0, scene, false, sampling);
        // Display
        var resultScene = result.getScene();
        var layer = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Layer(name + "_layer", null, resultScene, !foreground);
        layer.texture = result;
        result._layerToDispose = layer;
        result._isFullscreen = true;
        if (adaptiveScaling && resultScene) {
            var newScale = 1 / resultScene.getEngine().getHardwareScalingLevel();
            result._rootContainer.scaleX = newScale;
            result._rootContainer.scaleY = newScale;
        }
        // Attach
        result.attach();
        return result;
    };
    /**
     * Scales the texture
     * @param ratio the scale factor to apply to both width and height
     */
    AdvancedDynamicTexture.prototype.scale = function (ratio) {
        _super.prototype.scale.call(this, ratio);
        this.markAsDirty();
    };
    /**
     * Resizes the texture
     * @param width the new width
     * @param height the new height
     */
    AdvancedDynamicTexture.prototype.scaleTo = function (width, height) {
        _super.prototype.scaleTo.call(this, width, height);
        this.markAsDirty();
    };
    /** Define the Uurl to load snippets */
    AdvancedDynamicTexture.SnippetUrl = "https://snippet.babylonjs.com";
    /** Indicates if some optimizations can be performed in GUI GPU management (the downside is additional memory/GPU texture memory used) */
    AdvancedDynamicTexture.AllowGPUOptimizations = true;
    return AdvancedDynamicTexture;
}(core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.DynamicTexture));



/***/ }),

/***/ "../../../lts/gui/dist/2D/controls/button.js":
/*!***************************************************!*\
  !*** ../../../lts/gui/dist/2D/controls/button.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Button": () => (/* binding */ Button)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var _rectangle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rectangle */ "../../../lts/gui/dist/2D/controls/rectangle.js");
/* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./control */ "../../../lts/gui/dist/2D/controls/control.js");
/* harmony import */ var _textBlock__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./textBlock */ "../../../lts/gui/dist/2D/controls/textBlock.js");
/* harmony import */ var _image__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./image */ "../../../lts/gui/dist/2D/controls/image.js");
/* harmony import */ var core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core/Misc/typeStore */ "core/Misc/observable");
/* harmony import */ var core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_5__);






/**
 * Class used to create 2D buttons
 */
var Button = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(Button, _super);
    /**
     * Creates a new Button
     * @param name defines the name of the button
     */
    function Button(name) {
        var _this = _super.call(this, name) || this;
        _this.name = name;
        /**
         * Gets or sets a boolean indicating that the button will let internal controls handle picking instead of doing it directly using its bounding info
         */
        _this.delegatePickingToChildren = false;
        _this.thickness = 1;
        _this.isPointerBlocker = true;
        var alphaStore = null;
        _this.pointerEnterAnimation = function () {
            alphaStore = _this.alpha;
            _this.alpha -= 0.1;
        };
        _this.pointerOutAnimation = function () {
            if (alphaStore !== null) {
                _this.alpha = alphaStore;
            }
        };
        _this.pointerDownAnimation = function () {
            _this.scaleX -= 0.05;
            _this.scaleY -= 0.05;
        };
        _this.pointerUpAnimation = function () {
            _this.scaleX += 0.05;
            _this.scaleY += 0.05;
        };
        return _this;
    }
    Object.defineProperty(Button.prototype, "image", {
        /**
         * Returns the image part of the button (if any)
         */
        get: function () {
            return this._image;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Button.prototype, "textBlock", {
        /**
         * Returns the image part of the button (if any)
         */
        get: function () {
            return this._textBlock;
        },
        enumerable: false,
        configurable: true
    });
    Button.prototype._getTypeName = function () {
        return "Button";
    };
    // While being a container, the button behaves like a control.
    /**
     * @param x
     * @param y
     * @param pi
     * @param type
     * @param pointerId
     * @param buttonIndex
     * @param deltaX
     * @param deltaY
     * @hidden
     */
    Button.prototype._processPicking = function (x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY) {
        if (!this._isEnabled || !this.isHitTestVisible || !this.isVisible || this.notRenderable) {
            return false;
        }
        if (!_super.prototype.contains.call(this, x, y)) {
            return false;
        }
        if (this.delegatePickingToChildren) {
            var contains = false;
            for (var index = this._children.length - 1; index >= 0; index--) {
                var child = this._children[index];
                if (child.isEnabled && child.isHitTestVisible && child.isVisible && !child.notRenderable && child.contains(x, y)) {
                    contains = true;
                    break;
                }
            }
            if (!contains) {
                return false;
            }
        }
        this._processObservables(type, x, y, pi, pointerId, buttonIndex, deltaX, deltaY);
        return true;
    };
    /**
     * @param target
     * @param pi
     * @hidden
     */
    Button.prototype._onPointerEnter = function (target, pi) {
        if (!_super.prototype._onPointerEnter.call(this, target, pi)) {
            return false;
        }
        if (!this.isReadOnly && this.pointerEnterAnimation) {
            this.pointerEnterAnimation();
        }
        return true;
    };
    /**
     * @param target
     * @param pi
     * @param force
     * @hidden
     */
    Button.prototype._onPointerOut = function (target, pi, force) {
        if (force === void 0) { force = false; }
        if (!this.isReadOnly && this.pointerOutAnimation) {
            this.pointerOutAnimation();
        }
        _super.prototype._onPointerOut.call(this, target, pi, force);
    };
    /**
     * @param target
     * @param coordinates
     * @param pointerId
     * @param buttonIndex
     * @param pi
     * @hidden
     */
    Button.prototype._onPointerDown = function (target, coordinates, pointerId, buttonIndex, pi) {
        if (!_super.prototype._onPointerDown.call(this, target, coordinates, pointerId, buttonIndex, pi)) {
            return false;
        }
        if (!this.isReadOnly && this.pointerDownAnimation) {
            this.pointerDownAnimation();
        }
        return true;
    };
    /**
     * @param target
     * @param coordinates
     * @param pointerId
     * @param buttonIndex
     * @param notifyClick
     * @param pi
     * @hidden
     */
    Button.prototype._onPointerUp = function (target, coordinates, pointerId, buttonIndex, notifyClick, pi) {
        if (!this.isReadOnly && this.pointerUpAnimation) {
            this.pointerUpAnimation();
        }
        _super.prototype._onPointerUp.call(this, target, coordinates, pointerId, buttonIndex, notifyClick, pi);
    };
    /**
     * Serializes the current button
     * @param serializationObject defines the JSON serialized object
     */
    Button.prototype.serialize = function (serializationObject) {
        _super.prototype.serialize.call(this, serializationObject);
        if (this._textBlock) {
            serializationObject.textBlockName = this._textBlock.name;
        }
        if (this._image) {
            serializationObject.imageName = this._image.name;
        }
    };
    /**
     * @param serializedObject
     * @param host
     * @hidden
     */
    Button.prototype._parseFromContent = function (serializedObject, host) {
        _super.prototype._parseFromContent.call(this, serializedObject, host);
        if (serializedObject.textBlockName) {
            this._textBlock = this.getChildByName(serializedObject.textBlockName);
        }
        if (serializedObject.imageName) {
            this._image = this.getChildByName(serializedObject.imageName);
        }
    };
    // Statics
    /**
     * Creates a new button made with an image and a text
     * @param name defines the name of the button
     * @param text defines the text of the button
     * @param imageUrl defines the url of the image
     * @returns a new Button
     */
    Button.CreateImageButton = function (name, text, imageUrl) {
        var result = new this(name);
        // Adding text
        var textBlock = new _textBlock__WEBPACK_IMPORTED_MODULE_3__.TextBlock(name + "_button", text);
        textBlock.textWrapping = true;
        textBlock.textHorizontalAlignment = _control__WEBPACK_IMPORTED_MODULE_2__.Control.HORIZONTAL_ALIGNMENT_CENTER;
        textBlock.paddingLeft = "20%";
        result.addControl(textBlock);
        // Adding image
        var iconImage = new _image__WEBPACK_IMPORTED_MODULE_4__.Image(name + "_icon", imageUrl);
        iconImage.width = "20%";
        iconImage.stretch = _image__WEBPACK_IMPORTED_MODULE_4__.Image.STRETCH_UNIFORM;
        iconImage.horizontalAlignment = _control__WEBPACK_IMPORTED_MODULE_2__.Control.HORIZONTAL_ALIGNMENT_LEFT;
        result.addControl(iconImage);
        // Store
        result._image = iconImage;
        result._textBlock = textBlock;
        return result;
    };
    /**
     * Creates a new button made with an image
     * @param name defines the name of the button
     * @param imageUrl defines the url of the image
     * @returns a new Button
     */
    Button.CreateImageOnlyButton = function (name, imageUrl) {
        var result = new this(name);
        // Adding image
        var iconImage = new _image__WEBPACK_IMPORTED_MODULE_4__.Image(name + "_icon", imageUrl);
        iconImage.stretch = _image__WEBPACK_IMPORTED_MODULE_4__.Image.STRETCH_FILL;
        iconImage.horizontalAlignment = _control__WEBPACK_IMPORTED_MODULE_2__.Control.HORIZONTAL_ALIGNMENT_LEFT;
        result.addControl(iconImage);
        // Store
        result._image = iconImage;
        return result;
    };
    /**
     * Creates a new button made with a text
     * @param name defines the name of the button
     * @param text defines the text of the button
     * @returns a new Button
     */
    Button.CreateSimpleButton = function (name, text) {
        var result = new this(name);
        // Adding text
        var textBlock = new _textBlock__WEBPACK_IMPORTED_MODULE_3__.TextBlock(name + "_button", text);
        textBlock.textWrapping = true;
        textBlock.textHorizontalAlignment = _control__WEBPACK_IMPORTED_MODULE_2__.Control.HORIZONTAL_ALIGNMENT_CENTER;
        result.addControl(textBlock);
        // Store
        result._textBlock = textBlock;
        return result;
    };
    /**
     * Creates a new button made with an image and a centered text
     * @param name defines the name of the button
     * @param text defines the text of the button
     * @param imageUrl defines the url of the image
     * @returns a new Button
     */
    Button.CreateImageWithCenterTextButton = function (name, text, imageUrl) {
        var result = new this(name);
        // Adding image
        var iconImage = new _image__WEBPACK_IMPORTED_MODULE_4__.Image(name + "_icon", imageUrl);
        iconImage.stretch = _image__WEBPACK_IMPORTED_MODULE_4__.Image.STRETCH_FILL;
        result.addControl(iconImage);
        // Adding text
        var textBlock = new _textBlock__WEBPACK_IMPORTED_MODULE_3__.TextBlock(name + "_button", text);
        textBlock.textWrapping = true;
        textBlock.textHorizontalAlignment = _control__WEBPACK_IMPORTED_MODULE_2__.Control.HORIZONTAL_ALIGNMENT_CENTER;
        result.addControl(textBlock);
        // Store
        result._image = iconImage;
        result._textBlock = textBlock;
        return result;
    };
    return Button;
}(_rectangle__WEBPACK_IMPORTED_MODULE_1__.Rectangle));

(0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_5__.RegisterClass)("BABYLON.GUI.Button", Button);


/***/ }),

/***/ "../../../lts/gui/dist/2D/controls/checkbox.js":
/*!*****************************************************!*\
  !*** ../../../lts/gui/dist/2D/controls/checkbox.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Checkbox": () => (/* binding */ Checkbox)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Misc/decorators */ "core/Misc/observable");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./control */ "../../../lts/gui/dist/2D/controls/control.js");
/* harmony import */ var _stackPanel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./stackPanel */ "../../../lts/gui/dist/2D/controls/stackPanel.js");
/* harmony import */ var _textBlock__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./textBlock */ "../../../lts/gui/dist/2D/controls/textBlock.js");







/**
 * Class used to represent a 2D checkbox
 */
var Checkbox = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(Checkbox, _super);
    /**
     * Creates a new CheckBox
     * @param name defines the control name
     */
    function Checkbox(name) {
        var _this = _super.call(this, name) || this;
        _this.name = name;
        _this._isChecked = false;
        _this._background = "black";
        _this._checkSizeRatio = 0.8;
        _this._thickness = 1;
        /**
         * Observable raised when isChecked property changes
         */
        _this.onIsCheckedChangedObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        _this.isPointerBlocker = true;
        return _this;
    }
    Object.defineProperty(Checkbox.prototype, "thickness", {
        /** Gets or sets border thickness  */
        get: function () {
            return this._thickness;
        },
        set: function (value) {
            if (this._thickness === value) {
                return;
            }
            this._thickness = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Checkbox.prototype, "checkSizeRatio", {
        /** Gets or sets a value indicating the ratio between overall size and check size */
        get: function () {
            return this._checkSizeRatio;
        },
        set: function (value) {
            value = Math.max(Math.min(1, value), 0);
            if (this._checkSizeRatio === value) {
                return;
            }
            this._checkSizeRatio = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Checkbox.prototype, "background", {
        /** Gets or sets background color */
        get: function () {
            return this._background;
        },
        set: function (value) {
            if (this._background === value) {
                return;
            }
            this._background = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Checkbox.prototype, "isChecked", {
        /** Gets or sets a boolean indicating if the checkbox is checked or not */
        get: function () {
            return this._isChecked;
        },
        set: function (value) {
            if (this._isChecked === value) {
                return;
            }
            this._isChecked = value;
            this._markAsDirty();
            this.onIsCheckedChangedObservable.notifyObservers(value);
        },
        enumerable: false,
        configurable: true
    });
    Checkbox.prototype._getTypeName = function () {
        return "Checkbox";
    };
    /**
     * @param context
     * @hidden
     */
    Checkbox.prototype._draw = function (context) {
        context.save();
        this._applyStates(context);
        var actualWidth = this._currentMeasure.width - this._thickness;
        var actualHeight = this._currentMeasure.height - this._thickness;
        if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
            context.shadowColor = this.shadowColor;
            context.shadowBlur = this.shadowBlur;
            context.shadowOffsetX = this.shadowOffsetX;
            context.shadowOffsetY = this.shadowOffsetY;
        }
        context.fillStyle = this._isEnabled ? this._background : this._disabledColor;
        context.fillRect(this._currentMeasure.left + this._thickness / 2, this._currentMeasure.top + this._thickness / 2, actualWidth, actualHeight);
        if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
            context.shadowBlur = 0;
            context.shadowOffsetX = 0;
            context.shadowOffsetY = 0;
        }
        if (this._isChecked) {
            context.fillStyle = this._isEnabled ? this.color : this._disabledColorItem;
            var offsetWidth = actualWidth * this._checkSizeRatio;
            var offsetHeight = actualHeight * this._checkSizeRatio;
            context.fillRect(this._currentMeasure.left + this._thickness / 2 + (actualWidth - offsetWidth) / 2, this._currentMeasure.top + this._thickness / 2 + (actualHeight - offsetHeight) / 2, offsetWidth, offsetHeight);
        }
        context.strokeStyle = this.color;
        context.lineWidth = this._thickness;
        context.strokeRect(this._currentMeasure.left + this._thickness / 2, this._currentMeasure.top + this._thickness / 2, actualWidth, actualHeight);
        context.restore();
    };
    // Events
    /**
     * @param target
     * @param coordinates
     * @param pointerId
     * @param buttonIndex
     * @param pi
     * @hidden
     */
    Checkbox.prototype._onPointerDown = function (target, coordinates, pointerId, buttonIndex, pi) {
        if (!_super.prototype._onPointerDown.call(this, target, coordinates, pointerId, buttonIndex, pi)) {
            return false;
        }
        if (!this.isReadOnly) {
            this.isChecked = !this.isChecked;
        }
        return true;
    };
    /**
     * Utility function to easily create a checkbox with a header
     * @param title defines the label to use for the header
     * @param onValueChanged defines the callback to call when value changes
     * @returns a StackPanel containing the checkbox and a textBlock
     */
    Checkbox.AddCheckBoxWithHeader = function (title, onValueChanged) {
        var panel = new _stackPanel__WEBPACK_IMPORTED_MODULE_3__.StackPanel();
        panel.isVertical = false;
        panel.height = "30px";
        var checkbox = new Checkbox();
        checkbox.width = "20px";
        checkbox.height = "20px";
        checkbox.isChecked = true;
        checkbox.color = "green";
        checkbox.onIsCheckedChangedObservable.add(onValueChanged);
        panel.addControl(checkbox);
        var header = new _textBlock__WEBPACK_IMPORTED_MODULE_4__.TextBlock();
        header.text = title;
        header.width = "180px";
        header.paddingLeft = "5px";
        header.textHorizontalAlignment = _control__WEBPACK_IMPORTED_MODULE_2__.Control.HORIZONTAL_ALIGNMENT_LEFT;
        header.color = "white";
        panel.addControl(header);
        return panel;
    };
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Checkbox.prototype, "thickness", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Checkbox.prototype, "checkSizeRatio", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Checkbox.prototype, "background", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Checkbox.prototype, "isChecked", null);
    return Checkbox;
}(_control__WEBPACK_IMPORTED_MODULE_2__.Control));

(0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.RegisterClass)("BABYLON.GUI.Checkbox", Checkbox);


/***/ }),

/***/ "../../../lts/gui/dist/2D/controls/colorpicker.js":
/*!********************************************************!*\
  !*** ../../../lts/gui/dist/2D/controls/colorpicker.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "ColorPicker": () => (/* binding */ ColorPicker)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Engines/engineStore */ "core/Misc/observable");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./control */ "../../../lts/gui/dist/2D/controls/control.js");
/* harmony import */ var _inputText__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./inputText */ "../../../lts/gui/dist/2D/controls/inputText.js");
/* harmony import */ var _rectangle__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./rectangle */ "../../../lts/gui/dist/2D/controls/rectangle.js");
/* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./button */ "../../../lts/gui/dist/2D/controls/button.js");
/* harmony import */ var _grid__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./grid */ "../../../lts/gui/dist/2D/controls/grid.js");
/* harmony import */ var _controls_textBlock__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../controls/textBlock */ "../../../lts/gui/dist/2D/controls/textBlock.js");












/** Class used to create color pickers */
var ColorPicker = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(ColorPicker, _super);
    /**
     * Creates a new ColorPicker
     * @param name defines the control name
     */
    function ColorPicker(name) {
        var _this = _super.call(this, name) || this;
        _this.name = name;
        _this._value = core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Color3.Red();
        _this._tmpColor = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Color3();
        _this._pointerStartedOnSquare = false;
        _this._pointerStartedOnWheel = false;
        _this._squareLeft = 0;
        _this._squareTop = 0;
        _this._squareSize = 0;
        _this._h = 360;
        _this._s = 1;
        _this._v = 1;
        _this._lastPointerDownId = -1;
        /**
         * Observable raised when the value changes
         */
        _this.onValueChangedObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        // Events
        _this._pointerIsDown = false;
        _this.value = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Color3(0.88, 0.1, 0.1);
        _this.size = "200px";
        _this.isPointerBlocker = true;
        return _this;
    }
    Object.defineProperty(ColorPicker.prototype, "value", {
        /** Gets or sets the color of the color picker */
        get: function () {
            return this._value;
        },
        set: function (value) {
            if (this._value.equals(value)) {
                return;
            }
            this._value.copyFrom(value);
            this._value.toHSVToRef(this._tmpColor);
            this._h = this._tmpColor.r;
            this._s = Math.max(this._tmpColor.g, 0.00001);
            this._v = Math.max(this._tmpColor.b, 0.00001);
            this._markAsDirty();
            if (this._value.r <= ColorPicker._Epsilon) {
                this._value.r = 0;
            }
            if (this._value.g <= ColorPicker._Epsilon) {
                this._value.g = 0;
            }
            if (this._value.b <= ColorPicker._Epsilon) {
                this._value.b = 0;
            }
            if (this._value.r >= 1.0 - ColorPicker._Epsilon) {
                this._value.r = 1.0;
            }
            if (this._value.g >= 1.0 - ColorPicker._Epsilon) {
                this._value.g = 1.0;
            }
            if (this._value.b >= 1.0 - ColorPicker._Epsilon) {
                this._value.b = 1.0;
            }
            this.onValueChangedObservable.notifyObservers(this._value);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ColorPicker.prototype, "width", {
        /**
         * Gets or sets control width
         * @see https://doc.babylonjs.com/how_to/gui#position-and-size
         */
        get: function () {
            return this._width.toString(this._host);
        },
        set: function (value) {
            if (this._width.toString(this._host) === value) {
                return;
            }
            if (this._width.fromString(value)) {
                if (this._width.getValue(this._host) === 0) {
                    value = "1px";
                    this._width.fromString(value);
                }
                this._height.fromString(value);
                this._markAsDirty();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ColorPicker.prototype, "height", {
        /**
         * Gets or sets control height
         * @see https://doc.babylonjs.com/how_to/gui#position-and-size
         */
        get: function () {
            return this._height.toString(this._host);
        },
        /** Gets or sets control height */
        set: function (value) {
            if (this._height.toString(this._host) === value) {
                return;
            }
            if (this._height.fromString(value)) {
                if (this._height.getValue(this._host) === 0) {
                    value = "1px";
                    this._height.fromString(value);
                }
                this._width.fromString(value);
                this._markAsDirty();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ColorPicker.prototype, "size", {
        /** Gets or sets control size */
        get: function () {
            return this.width;
        },
        set: function (value) {
            this.width = value;
        },
        enumerable: false,
        configurable: true
    });
    ColorPicker.prototype._getTypeName = function () {
        return "ColorPicker";
    };
    /**
     * @param parentMeasure
     * @hidden
     */
    ColorPicker.prototype._preMeasure = function (parentMeasure) {
        if (parentMeasure.width < parentMeasure.height) {
            this._currentMeasure.height = parentMeasure.width;
        }
        else {
            this._currentMeasure.width = parentMeasure.height;
        }
    };
    ColorPicker.prototype._updateSquareProps = function () {
        var radius = Math.min(this._currentMeasure.width, this._currentMeasure.height) * 0.5;
        var wheelThickness = radius * 0.2;
        var innerDiameter = (radius - wheelThickness) * 2;
        var squareSize = innerDiameter / Math.sqrt(2);
        var offset = radius - squareSize * 0.5;
        this._squareLeft = this._currentMeasure.left + offset;
        this._squareTop = this._currentMeasure.top + offset;
        this._squareSize = squareSize;
    };
    ColorPicker.prototype._drawGradientSquare = function (hueValue, left, top, width, height, context) {
        var lgh = context.createLinearGradient(left, top, width + left, top);
        lgh.addColorStop(0, "#fff");
        lgh.addColorStop(1, "hsl(" + hueValue + ", 100%, 50%)");
        context.fillStyle = lgh;
        context.fillRect(left, top, width, height);
        var lgv = context.createLinearGradient(left, top, left, height + top);
        lgv.addColorStop(0, "rgba(0,0,0,0)");
        lgv.addColorStop(1, "#000");
        context.fillStyle = lgv;
        context.fillRect(left, top, width, height);
    };
    ColorPicker.prototype._drawCircle = function (centerX, centerY, radius, context) {
        context.beginPath();
        context.arc(centerX, centerY, radius + 1, 0, 2 * Math.PI, false);
        context.lineWidth = 3;
        context.strokeStyle = "#333333";
        context.stroke();
        context.beginPath();
        context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false);
        context.lineWidth = 3;
        context.strokeStyle = "#ffffff";
        context.stroke();
    };
    ColorPicker.prototype._createColorWheelCanvas = function (radius, thickness) {
        // Shoudl abstract platform instead of using LastCreatedEngine
        var engine = core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.EngineStore.LastCreatedEngine;
        if (!engine) {
            throw new Error("Invalid engine. Unable to create a canvas.");
        }
        var canvas = engine.createCanvas(radius * 2, radius * 2);
        var context = canvas.getContext("2d");
        var image = context.getImageData(0, 0, radius * 2, radius * 2);
        var data = image.data;
        var color = this._tmpColor;
        var maxDistSq = radius * radius;
        var innerRadius = radius - thickness;
        var minDistSq = innerRadius * innerRadius;
        for (var x = -radius; x < radius; x++) {
            for (var y = -radius; y < radius; y++) {
                var distSq = x * x + y * y;
                if (distSq > maxDistSq || distSq < minDistSq) {
                    continue;
                }
                var dist = Math.sqrt(distSq);
                var ang = Math.atan2(y, x);
                core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Color3.HSVtoRGBToRef((ang * 180) / Math.PI + 180, dist / radius, 1, color);
                var index = (x + radius + (y + radius) * 2 * radius) * 4;
                data[index] = color.r * 255;
                data[index + 1] = color.g * 255;
                data[index + 2] = color.b * 255;
                var alphaRatio = (dist - innerRadius) / (radius - innerRadius);
                //apply less alpha to bigger color pickers
                var alphaAmount = 0.2;
                var maxAlpha = 0.2;
                var minAlpha = 0.04;
                var lowerRadius = 50;
                var upperRadius = 150;
                if (radius < lowerRadius) {
                    alphaAmount = maxAlpha;
                }
                else if (radius > upperRadius) {
                    alphaAmount = minAlpha;
                }
                else {
                    alphaAmount = ((minAlpha - maxAlpha) * (radius - lowerRadius)) / (upperRadius - lowerRadius) + maxAlpha;
                }
                alphaRatio = (dist - innerRadius) / (radius - innerRadius);
                if (alphaRatio < alphaAmount) {
                    data[index + 3] = 255 * (alphaRatio / alphaAmount);
                }
                else if (alphaRatio > 1 - alphaAmount) {
                    data[index + 3] = 255 * (1.0 - (alphaRatio - (1 - alphaAmount)) / alphaAmount);
                }
                else {
                    data[index + 3] = 255;
                }
            }
        }
        context.putImageData(image, 0, 0);
        return canvas;
    };
    /**
     * @param context
     * @hidden
     */
    ColorPicker.prototype._draw = function (context) {
        context.save();
        this._applyStates(context);
        var radius = Math.min(this._currentMeasure.width, this._currentMeasure.height) * 0.5;
        var wheelThickness = radius * 0.2;
        var left = this._currentMeasure.left;
        var top = this._currentMeasure.top;
        if (!this._colorWheelCanvas || this._colorWheelCanvas.width != radius * 2) {
            this._colorWheelCanvas = this._createColorWheelCanvas(radius, wheelThickness);
        }
        this._updateSquareProps();
        if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
            context.shadowColor = this.shadowColor;
            context.shadowBlur = this.shadowBlur;
            context.shadowOffsetX = this.shadowOffsetX;
            context.shadowOffsetY = this.shadowOffsetY;
            context.fillRect(this._squareLeft, this._squareTop, this._squareSize, this._squareSize);
        }
        context.drawImage(this._colorWheelCanvas, left, top);
        if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
            context.shadowBlur = 0;
            context.shadowOffsetX = 0;
            context.shadowOffsetY = 0;
        }
        this._drawGradientSquare(this._h, this._squareLeft, this._squareTop, this._squareSize, this._squareSize, context);
        var cx = this._squareLeft + this._squareSize * this._s;
        var cy = this._squareTop + this._squareSize * (1 - this._v);
        this._drawCircle(cx, cy, radius * 0.04, context);
        var dist = radius - wheelThickness * 0.5;
        cx = left + radius + Math.cos(((this._h - 180) * Math.PI) / 180) * dist;
        cy = top + radius + Math.sin(((this._h - 180) * Math.PI) / 180) * dist;
        this._drawCircle(cx, cy, wheelThickness * 0.35, context);
        context.restore();
    };
    ColorPicker.prototype._updateValueFromPointer = function (x, y) {
        if (this._pointerStartedOnWheel) {
            var radius = Math.min(this._currentMeasure.width, this._currentMeasure.height) * 0.5;
            var centerX = radius + this._currentMeasure.left;
            var centerY = radius + this._currentMeasure.top;
            this._h = (Math.atan2(y - centerY, x - centerX) * 180) / Math.PI + 180;
        }
        else if (this._pointerStartedOnSquare) {
            this._updateSquareProps();
            this._s = (x - this._squareLeft) / this._squareSize;
            this._v = 1 - (y - this._squareTop) / this._squareSize;
            this._s = Math.min(this._s, 1);
            this._s = Math.max(this._s, ColorPicker._Epsilon);
            this._v = Math.min(this._v, 1);
            this._v = Math.max(this._v, ColorPicker._Epsilon);
        }
        core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Color3.HSVtoRGBToRef(this._h, this._s, this._v, this._tmpColor);
        this.value = this._tmpColor;
    };
    ColorPicker.prototype._isPointOnSquare = function (x, y) {
        this._updateSquareProps();
        var left = this._squareLeft;
        var top = this._squareTop;
        var size = this._squareSize;
        if (x >= left && x <= left + size && y >= top && y <= top + size) {
            return true;
        }
        return false;
    };
    ColorPicker.prototype._isPointOnWheel = function (x, y) {
        var radius = Math.min(this._currentMeasure.width, this._currentMeasure.height) * 0.5;
        var centerX = radius + this._currentMeasure.left;
        var centerY = radius + this._currentMeasure.top;
        var wheelThickness = radius * 0.2;
        var innerRadius = radius - wheelThickness;
        var radiusSq = radius * radius;
        var innerRadiusSq = innerRadius * innerRadius;
        var dx = x - centerX;
        var dy = y - centerY;
        var distSq = dx * dx + dy * dy;
        if (distSq <= radiusSq && distSq >= innerRadiusSq) {
            return true;
        }
        return false;
    };
    ColorPicker.prototype._onPointerDown = function (target, coordinates, pointerId, buttonIndex, pi) {
        if (!_super.prototype._onPointerDown.call(this, target, coordinates, pointerId, buttonIndex, pi)) {
            return false;
        }
        if (this.isReadOnly) {
            return true;
        }
        this._pointerIsDown = true;
        this._pointerStartedOnSquare = false;
        this._pointerStartedOnWheel = false;
        // Invert transform
        this._invertTransformMatrix.transformCoordinates(coordinates.x, coordinates.y, this._transformedPosition);
        var x = this._transformedPosition.x;
        var y = this._transformedPosition.y;
        if (this._isPointOnSquare(x, y)) {
            this._pointerStartedOnSquare = true;
        }
        else if (this._isPointOnWheel(x, y)) {
            this._pointerStartedOnWheel = true;
        }
        this._updateValueFromPointer(x, y);
        this._host._capturingControl[pointerId] = this;
        this._lastPointerDownId = pointerId;
        return true;
    };
    ColorPicker.prototype._onPointerMove = function (target, coordinates, pointerId, pi) {
        // Only listen to pointer move events coming from the last pointer to click on the element (To support dual vr controller interaction)
        if (pointerId != this._lastPointerDownId) {
            return;
        }
        if (!this.isReadOnly) {
            // Invert transform
            this._invertTransformMatrix.transformCoordinates(coordinates.x, coordinates.y, this._transformedPosition);
            var x = this._transformedPosition.x;
            var y = this._transformedPosition.y;
            if (this._pointerIsDown) {
                this._updateValueFromPointer(x, y);
            }
        }
        _super.prototype._onPointerMove.call(this, target, coordinates, pointerId, pi);
    };
    ColorPicker.prototype._onPointerUp = function (target, coordinates, pointerId, buttonIndex, notifyClick, pi) {
        this._pointerIsDown = false;
        delete this._host._capturingControl[pointerId];
        _super.prototype._onPointerUp.call(this, target, coordinates, pointerId, buttonIndex, notifyClick, pi);
    };
    ColorPicker.prototype._onCanvasBlur = function () {
        this._forcePointerUp();
        _super.prototype._onCanvasBlur.call(this);
    };
    /**
     * This function expands the color picker by creating a color picker dialog with manual
     * color value input and the ability to save colors into an array to be used later in
     * subsequent launches of the dialogue.
     * @param advancedTexture defines the AdvancedDynamicTexture the dialog is assigned to
     * @param options defines size for dialog and options for saved colors. Also accepts last color picked as hex string and saved colors array as hex strings.
     * @param options.pickerWidth
     * @param options.pickerHeight
     * @param options.headerHeight
     * @param options.lastColor
     * @param options.swatchLimit
     * @param options.numSwatchesPerLine
     * @param options.savedColors
     * @returns picked color as a hex string and the saved colors array as hex strings.
     */
    ColorPicker.ShowPickerDialogAsync = function (advancedTexture, options) {
        return new Promise(function (resolve) {
            // Default options
            options.pickerWidth = options.pickerWidth || "640px";
            options.pickerHeight = options.pickerHeight || "400px";
            options.headerHeight = options.headerHeight || "35px";
            options.lastColor = options.lastColor || "#000000";
            options.swatchLimit = options.swatchLimit || 20;
            options.numSwatchesPerLine = options.numSwatchesPerLine || 10;
            // Window size settings
            var drawerMaxRows = options.swatchLimit / options.numSwatchesPerLine;
            var rawSwatchSize = parseFloat(options.pickerWidth) / options.numSwatchesPerLine;
            var gutterSize = Math.floor(rawSwatchSize * 0.25);
            var colGutters = gutterSize * (options.numSwatchesPerLine + 1);
            var swatchSize = Math.floor((parseFloat(options.pickerWidth) - colGutters) / options.numSwatchesPerLine);
            var drawerMaxSize = swatchSize * drawerMaxRows + gutterSize * (drawerMaxRows + 1);
            var containerSize = (parseInt(options.pickerHeight) + drawerMaxSize + Math.floor(swatchSize * 0.25)).toString() + "px";
            // Button Colors
            var buttonColor = "#c0c0c0";
            var buttonBackgroundColor = "#535353";
            var buttonBackgroundHoverColor = "#414141";
            var buttonBackgroundClickColor = "515151";
            var buttonDisabledColor = "#555555";
            var buttonDisabledBackgroundColor = "#454545";
            var currentSwatchesOutlineColor = "#404040";
            var luminanceLimitColor = core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Color3.FromHexString("#dddddd");
            var luminanceLimit = luminanceLimitColor.r + luminanceLimitColor.g + luminanceLimitColor.b;
            var iconColorDark = "#aaaaaa";
            var iconColorLight = "#ffffff";
            // Button settings
            var buttonFontSize;
            var butEdit;
            // Input Text Colors
            var inputFieldLabels = ["R", "G", "B"];
            var inputTextBackgroundColor = "#454545";
            var inputTextColor = "#f0f0f0";
            // This int is used for naming swatches and serves as the index for calling them from the list
            var swatchNumber;
            // Menu Panel options. We need to know if the swatchDrawer exists so we can create it if needed.
            var swatchDrawer;
            var editSwatchMode = false;
            // Color InputText fields that will be updated upon value change
            var butSave;
            var lastVal;
            var activeField;
            // Dialog menu container which will contain both the main dialogue window and the swatch drawer which opens once a color is saved.
            var dialogContainer = new _grid__WEBPACK_IMPORTED_MODULE_6__.Grid();
            dialogContainer.name = "Dialog Container";
            dialogContainer.width = options.pickerWidth;
            if (options.savedColors) {
                dialogContainer.height = containerSize;
                var topRow = parseInt(options.pickerHeight) / parseInt(containerSize);
                dialogContainer.addRowDefinition(topRow, false);
                dialogContainer.addRowDefinition(1.0 - topRow, false);
            }
            else {
                dialogContainer.height = options.pickerHeight;
                dialogContainer.addRowDefinition(1.0, false);
            }
            advancedTexture.addControl(dialogContainer);
            // Swatch drawer which contains all saved color buttons
            if (options.savedColors) {
                swatchDrawer = new _grid__WEBPACK_IMPORTED_MODULE_6__.Grid();
                swatchDrawer.name = "Swatch Drawer";
                swatchDrawer.verticalAlignment = _control__WEBPACK_IMPORTED_MODULE_2__.Control.VERTICAL_ALIGNMENT_TOP;
                swatchDrawer.background = buttonBackgroundColor;
                swatchDrawer.width = options.pickerWidth;
                var initialRows = options.savedColors.length / options.numSwatchesPerLine;
                var gutterCount = void 0;
                if (initialRows == 0) {
                    gutterCount = 0;
                }
                else {
                    gutterCount = initialRows + 1;
                }
                swatchDrawer.height = (swatchSize * initialRows + gutterCount * gutterSize).toString() + "px";
                swatchDrawer.top = Math.floor(swatchSize * 0.25).toString() + "px";
                for (var i = 0; i < Math.ceil(options.savedColors.length / options.numSwatchesPerLine) * 2 + 1; i++) {
                    if (i % 2 != 0) {
                        swatchDrawer.addRowDefinition(swatchSize, true);
                    }
                    else {
                        swatchDrawer.addRowDefinition(gutterSize, true);
                    }
                }
                for (var i = 0; i < options.numSwatchesPerLine * 2 + 1; i++) {
                    if (i % 2 != 0) {
                        swatchDrawer.addColumnDefinition(swatchSize, true);
                    }
                    else {
                        swatchDrawer.addColumnDefinition(gutterSize, true);
                    }
                }
                dialogContainer.addControl(swatchDrawer, 1, 0);
            }
            // Picker container
            var pickerPanel = new _grid__WEBPACK_IMPORTED_MODULE_6__.Grid();
            pickerPanel.name = "Picker Panel";
            pickerPanel.height = options.pickerHeight;
            var panelHead = parseInt(options.headerHeight) / parseInt(options.pickerHeight);
            var pickerPanelRows = [panelHead, 1.0 - panelHead];
            pickerPanel.addRowDefinition(pickerPanelRows[0], false);
            pickerPanel.addRowDefinition(pickerPanelRows[1], false);
            dialogContainer.addControl(pickerPanel, 0, 0);
            // Picker container header
            var header = new _rectangle__WEBPACK_IMPORTED_MODULE_4__.Rectangle();
            header.name = "Dialogue Header Bar";
            header.background = "#cccccc";
            header.thickness = 0;
            pickerPanel.addControl(header, 0, 0);
            // Header close button
            var closeButton = _button__WEBPACK_IMPORTED_MODULE_5__.Button.CreateSimpleButton("closeButton", "a");
            closeButton.fontFamily = "coreglyphs";
            var headerColor3 = core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Color3.FromHexString(header.background);
            var closeIconColor = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Color3(1.0 - headerColor3.r, 1.0 - headerColor3.g, 1.0 - headerColor3.b);
            closeButton.color = closeIconColor.toHexString();
            closeButton.fontSize = Math.floor(parseInt(options.headerHeight) * 0.6);
            closeButton.textBlock.textVerticalAlignment = _control__WEBPACK_IMPORTED_MODULE_2__.Control.VERTICAL_ALIGNMENT_CENTER;
            closeButton.horizontalAlignment = _control__WEBPACK_IMPORTED_MODULE_2__.Control.HORIZONTAL_ALIGNMENT_RIGHT;
            closeButton.height = closeButton.width = options.headerHeight;
            closeButton.background = header.background;
            closeButton.thickness = 0;
            closeButton.pointerDownAnimation = function () { };
            closeButton.pointerUpAnimation = function () {
                closeButton.background = header.background;
            };
            closeButton.pointerEnterAnimation = function () {
                closeButton.color = header.background;
                closeButton.background = "red";
            };
            closeButton.pointerOutAnimation = function () {
                closeButton.color = closeIconColor.toHexString();
                closeButton.background = header.background;
            };
            closeButton.onPointerClickObservable.add(function () {
                closePicker(currentSwatch.background);
            });
            pickerPanel.addControl(closeButton, 0, 0);
            // Dialog container body
            var dialogBody = new _grid__WEBPACK_IMPORTED_MODULE_6__.Grid();
            dialogBody.name = "Dialogue Body";
            dialogBody.background = buttonBackgroundColor;
            var dialogBodyCols = [0.4375, 0.5625];
            dialogBody.addRowDefinition(1.0, false);
            dialogBody.addColumnDefinition(dialogBodyCols[0], false);
            dialogBody.addColumnDefinition(dialogBodyCols[1], false);
            pickerPanel.addControl(dialogBody, 1, 0);
            // Picker grid
            var pickerGrid = new _grid__WEBPACK_IMPORTED_MODULE_6__.Grid();
            pickerGrid.name = "Picker Grid";
            pickerGrid.addRowDefinition(0.85, false);
            pickerGrid.addRowDefinition(0.15, false);
            dialogBody.addControl(pickerGrid, 0, 0);
            //  Picker control
            var picker = new ColorPicker();
            picker.name = "GUI Color Picker";
            if (options.pickerHeight < options.pickerWidth) {
                picker.width = 0.89;
            }
            else {
                picker.height = 0.89;
            }
            picker.value = core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Color3.FromHexString(options.lastColor);
            picker.horizontalAlignment = _control__WEBPACK_IMPORTED_MODULE_2__.Control.HORIZONTAL_ALIGNMENT_CENTER;
            picker.verticalAlignment = _control__WEBPACK_IMPORTED_MODULE_2__.Control.VERTICAL_ALIGNMENT_CENTER;
            picker.onPointerDownObservable.add(function () {
                activeField = picker.name;
                lastVal = "";
                editSwatches(false);
            });
            picker.onValueChangedObservable.add(function (value) {
                // value is a color3
                if (activeField == picker.name) {
                    updateValues(value, picker.name);
                }
            });
            pickerGrid.addControl(picker, 0, 0);
            // Picker body right quarant
            var pickerBodyRight = new _grid__WEBPACK_IMPORTED_MODULE_6__.Grid();
            pickerBodyRight.name = "Dialogue Right Half";
            pickerBodyRight.horizontalAlignment = _control__WEBPACK_IMPORTED_MODULE_2__.Control.HORIZONTAL_ALIGNMENT_LEFT;
            var pickerBodyRightRows = [0.514, 0.486];
            pickerBodyRight.addRowDefinition(pickerBodyRightRows[0], false);
            pickerBodyRight.addRowDefinition(pickerBodyRightRows[1], false);
            dialogBody.addControl(pickerBodyRight, 1, 1);
            // Picker container swatches and buttons
            var pickerSwatchesButtons = new _grid__WEBPACK_IMPORTED_MODULE_6__.Grid();
            pickerSwatchesButtons.name = "Swatches and Buttons";
            var pickerButtonsCol = [0.417, 0.583];
            pickerSwatchesButtons.addRowDefinition(1.0, false);
            pickerSwatchesButtons.addColumnDefinition(pickerButtonsCol[0], false);
            pickerSwatchesButtons.addColumnDefinition(pickerButtonsCol[1], false);
            pickerBodyRight.addControl(pickerSwatchesButtons, 0, 0);
            // Picker Swatches quadrant
            var pickerSwatches = new _grid__WEBPACK_IMPORTED_MODULE_6__.Grid();
            pickerSwatches.name = "New and Current Swatches";
            var pickeSwatchesRows = [0.04, 0.16, 0.64, 0.16];
            pickerSwatches.addRowDefinition(pickeSwatchesRows[0], false);
            pickerSwatches.addRowDefinition(pickeSwatchesRows[1], false);
            pickerSwatches.addRowDefinition(pickeSwatchesRows[2], false);
            pickerSwatches.addRowDefinition(pickeSwatchesRows[3], false);
            pickerSwatchesButtons.addControl(pickerSwatches, 0, 0);
            // Active swatches
            var activeSwatches = new _grid__WEBPACK_IMPORTED_MODULE_6__.Grid();
            activeSwatches.name = "Active Swatches";
            activeSwatches.width = 0.67;
            activeSwatches.addRowDefinition(0.5, false);
            activeSwatches.addRowDefinition(0.5, false);
            pickerSwatches.addControl(activeSwatches, 2, 0);
            var labelWidth = Math.floor(parseInt(options.pickerWidth) * dialogBodyCols[1] * pickerButtonsCol[0] * 0.11);
            var labelHeight = Math.floor(parseInt(options.pickerHeight) * pickerPanelRows[1] * pickerBodyRightRows[0] * pickeSwatchesRows[1] * 0.5);
            var labelTextSize;
            if (options.pickerWidth > options.pickerHeight) {
                labelTextSize = labelHeight;
            }
            else {
                labelTextSize = labelWidth;
            }
            // New color swatch and previous color button
            var newText = new _controls_textBlock__WEBPACK_IMPORTED_MODULE_7__.TextBlock();
            newText.text = "new";
            newText.name = "New Color Label";
            newText.color = buttonColor;
            newText.fontSize = labelTextSize;
            pickerSwatches.addControl(newText, 1, 0);
            var newSwatch = new _rectangle__WEBPACK_IMPORTED_MODULE_4__.Rectangle();
            newSwatch.name = "New Color Swatch";
            newSwatch.background = options.lastColor;
            newSwatch.thickness = 0;
            activeSwatches.addControl(newSwatch, 0, 0);
            var currentSwatch = _button__WEBPACK_IMPORTED_MODULE_5__.Button.CreateSimpleButton("currentSwatch", "");
            currentSwatch.background = options.lastColor;
            currentSwatch.thickness = 0;
            currentSwatch.onPointerClickObservable.add(function () {
                var revertColor = core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Color3.FromHexString(currentSwatch.background);
                updateValues(revertColor, currentSwatch.name);
                editSwatches(false);
            });
            currentSwatch.pointerDownAnimation = function () { };
            currentSwatch.pointerUpAnimation = function () { };
            currentSwatch.pointerEnterAnimation = function () { };
            currentSwatch.pointerOutAnimation = function () { };
            activeSwatches.addControl(currentSwatch, 1, 0);
            var swatchOutline = new _rectangle__WEBPACK_IMPORTED_MODULE_4__.Rectangle();
            swatchOutline.name = "Swatch Outline";
            swatchOutline.width = 0.67;
            swatchOutline.thickness = 2;
            swatchOutline.color = currentSwatchesOutlineColor;
            swatchOutline.isHitTestVisible = false;
            pickerSwatches.addControl(swatchOutline, 2, 0);
            var currentText = new _controls_textBlock__WEBPACK_IMPORTED_MODULE_7__.TextBlock();
            currentText.name = "Current Color Label";
            currentText.text = "current";
            currentText.color = buttonColor;
            currentText.fontSize = labelTextSize;
            pickerSwatches.addControl(currentText, 3, 0);
            // Buttons grid
            var buttonGrid = new _grid__WEBPACK_IMPORTED_MODULE_6__.Grid();
            buttonGrid.name = "Button Grid";
            buttonGrid.height = 0.8;
            var buttonGridRows = 1 / 3;
            buttonGrid.addRowDefinition(buttonGridRows, false);
            buttonGrid.addRowDefinition(buttonGridRows, false);
            buttonGrid.addRowDefinition(buttonGridRows, false);
            pickerSwatchesButtons.addControl(buttonGrid, 0, 1);
            // Determine pixel width and height for all buttons from overall panel dimensions
            var buttonWidth = Math.floor(parseInt(options.pickerWidth) * dialogBodyCols[1] * pickerButtonsCol[1] * 0.67).toString() + "px";
            var buttonHeight = Math.floor(parseInt(options.pickerHeight) * pickerPanelRows[1] * pickerBodyRightRows[0] * (parseFloat(buttonGrid.height.toString()) / 100) * buttonGridRows * 0.7).toString() + "px";
            // Determine button type size
            if (parseFloat(buttonWidth) > parseFloat(buttonHeight)) {
                buttonFontSize = Math.floor(parseFloat(buttonHeight) * 0.45);
            }
            else {
                buttonFontSize = Math.floor(parseFloat(buttonWidth) * 0.11);
            }
            // Panel Buttons
            var butOK = _button__WEBPACK_IMPORTED_MODULE_5__.Button.CreateSimpleButton("butOK", "OK");
            butOK.width = buttonWidth;
            butOK.height = buttonHeight;
            butOK.verticalAlignment = _control__WEBPACK_IMPORTED_MODULE_2__.Control.VERTICAL_ALIGNMENT_CENTER;
            butOK.thickness = 2;
            butOK.color = buttonColor;
            butOK.fontSize = buttonFontSize;
            butOK.background = buttonBackgroundColor;
            butOK.onPointerEnterObservable.add(function () {
                butOK.background = buttonBackgroundHoverColor;
            });
            butOK.onPointerOutObservable.add(function () {
                butOK.background = buttonBackgroundColor;
            });
            butOK.pointerDownAnimation = function () {
                butOK.background = buttonBackgroundClickColor;
            };
            butOK.pointerUpAnimation = function () {
                butOK.background = buttonBackgroundHoverColor;
            };
            butOK.onPointerClickObservable.add(function () {
                editSwatches(false);
                closePicker(newSwatch.background);
            });
            buttonGrid.addControl(butOK, 0, 0);
            var butCancel = _button__WEBPACK_IMPORTED_MODULE_5__.Button.CreateSimpleButton("butCancel", "Cancel");
            butCancel.width = buttonWidth;
            butCancel.height = buttonHeight;
            butCancel.verticalAlignment = _control__WEBPACK_IMPORTED_MODULE_2__.Control.VERTICAL_ALIGNMENT_CENTER;
            butCancel.thickness = 2;
            butCancel.color = buttonColor;
            butCancel.fontSize = buttonFontSize;
            butCancel.background = buttonBackgroundColor;
            butCancel.onPointerEnterObservable.add(function () {
                butCancel.background = buttonBackgroundHoverColor;
            });
            butCancel.onPointerOutObservable.add(function () {
                butCancel.background = buttonBackgroundColor;
            });
            butCancel.pointerDownAnimation = function () {
                butCancel.background = buttonBackgroundClickColor;
            };
            butCancel.pointerUpAnimation = function () {
                butCancel.background = buttonBackgroundHoverColor;
            };
            butCancel.onPointerClickObservable.add(function () {
                editSwatches(false);
                closePicker(currentSwatch.background);
            });
            buttonGrid.addControl(butCancel, 1, 0);
            if (options.savedColors) {
                butSave = _button__WEBPACK_IMPORTED_MODULE_5__.Button.CreateSimpleButton("butSave", "Save");
                butSave.width = buttonWidth;
                butSave.height = buttonHeight;
                butSave.verticalAlignment = _control__WEBPACK_IMPORTED_MODULE_2__.Control.VERTICAL_ALIGNMENT_CENTER;
                butSave.thickness = 2;
                butSave.fontSize = buttonFontSize;
                if (options.savedColors.length < options.swatchLimit) {
                    butSave.color = buttonColor;
                    butSave.background = buttonBackgroundColor;
                }
                else {
                    disableButton(butSave, true);
                }
                butSave.onPointerEnterObservable.add(function () {
                    if (options.savedColors) {
                        if (options.savedColors.length < options.swatchLimit) {
                            butSave.background = buttonBackgroundHoverColor;
                        }
                    }
                });
                butSave.onPointerOutObservable.add(function () {
                    if (options.savedColors) {
                        if (options.savedColors.length < options.swatchLimit) {
                            butSave.background = buttonBackgroundColor;
                        }
                    }
                });
                butSave.pointerDownAnimation = function () {
                    if (options.savedColors) {
                        if (options.savedColors.length < options.swatchLimit) {
                            butSave.background = buttonBackgroundClickColor;
                        }
                    }
                };
                butSave.pointerUpAnimation = function () {
                    if (options.savedColors) {
                        if (options.savedColors.length < options.swatchLimit) {
                            butSave.background = buttonBackgroundHoverColor;
                        }
                    }
                };
                butSave.onPointerClickObservable.add(function () {
                    if (options.savedColors) {
                        if (options.savedColors.length == 0) {
                            setEditButtonVisibility(true);
                        }
                        if (options.savedColors.length < options.swatchLimit) {
                            updateSwatches(newSwatch.background, butSave);
                        }
                        editSwatches(false);
                    }
                });
                if (options.savedColors.length > 0) {
                    setEditButtonVisibility(true);
                }
                buttonGrid.addControl(butSave, 2, 0);
            }
            // Picker color values input
            var pickerColorValues = new _grid__WEBPACK_IMPORTED_MODULE_6__.Grid();
            pickerColorValues.name = "Dialog Lower Right";
            pickerColorValues.addRowDefinition(0.02, false);
            pickerColorValues.addRowDefinition(0.63, false);
            pickerColorValues.addRowDefinition(0.21, false);
            pickerColorValues.addRowDefinition(0.14, false);
            pickerBodyRight.addControl(pickerColorValues, 1, 0);
            // RGB values text boxes
            var currentColor = core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Color3.FromHexString(options.lastColor);
            var rgbValuesQuadrant = new _grid__WEBPACK_IMPORTED_MODULE_6__.Grid();
            rgbValuesQuadrant.name = "RGB Values";
            rgbValuesQuadrant.width = 0.82;
            rgbValuesQuadrant.verticalAlignment = _control__WEBPACK_IMPORTED_MODULE_2__.Control.VERTICAL_ALIGNMENT_CENTER;
            rgbValuesQuadrant.addRowDefinition(1 / 3, false);
            rgbValuesQuadrant.addRowDefinition(1 / 3, false);
            rgbValuesQuadrant.addRowDefinition(1 / 3, false);
            rgbValuesQuadrant.addColumnDefinition(0.1, false);
            rgbValuesQuadrant.addColumnDefinition(0.2, false);
            rgbValuesQuadrant.addColumnDefinition(0.7, false);
            pickerColorValues.addControl(rgbValuesQuadrant, 1, 0);
            for (var i = 0; i < inputFieldLabels.length; i++) {
                var labelText_1 = new _controls_textBlock__WEBPACK_IMPORTED_MODULE_7__.TextBlock();
                labelText_1.text = inputFieldLabels[i];
                labelText_1.color = buttonColor;
                labelText_1.fontSize = buttonFontSize;
                rgbValuesQuadrant.addControl(labelText_1, i, 0);
            }
            // Input fields for RGB values
            var rValInt = new _inputText__WEBPACK_IMPORTED_MODULE_3__.InputText();
            rValInt.width = 0.83;
            rValInt.height = 0.72;
            rValInt.name = "rIntField";
            rValInt.fontSize = buttonFontSize;
            rValInt.text = (currentColor.r * 255).toString();
            rValInt.color = inputTextColor;
            rValInt.background = inputTextBackgroundColor;
            rValInt.onFocusObservable.add(function () {
                activeField = rValInt.name;
                lastVal = rValInt.text;
                editSwatches(false);
            });
            rValInt.onBlurObservable.add(function () {
                if (rValInt.text == "") {
                    rValInt.text = "0";
                }
                updateInt(rValInt, "r");
                if (activeField == rValInt.name) {
                    activeField = "";
                }
            });
            rValInt.onTextChangedObservable.add(function () {
                if (activeField == rValInt.name) {
                    updateInt(rValInt, "r");
                }
            });
            rgbValuesQuadrant.addControl(rValInt, 0, 1);
            var gValInt = new _inputText__WEBPACK_IMPORTED_MODULE_3__.InputText();
            gValInt.width = 0.83;
            gValInt.height = 0.72;
            gValInt.name = "gIntField";
            gValInt.fontSize = buttonFontSize;
            gValInt.text = (currentColor.g * 255).toString();
            gValInt.color = inputTextColor;
            gValInt.background = inputTextBackgroundColor;
            gValInt.onFocusObservable.add(function () {
                activeField = gValInt.name;
                lastVal = gValInt.text;
                editSwatches(false);
            });
            gValInt.onBlurObservable.add(function () {
                if (gValInt.text == "") {
                    gValInt.text = "0";
                }
                updateInt(gValInt, "g");
                if (activeField == gValInt.name) {
                    activeField = "";
                }
            });
            gValInt.onTextChangedObservable.add(function () {
                if (activeField == gValInt.name) {
                    updateInt(gValInt, "g");
                }
            });
            rgbValuesQuadrant.addControl(gValInt, 1, 1);
            var bValInt = new _inputText__WEBPACK_IMPORTED_MODULE_3__.InputText();
            bValInt.width = 0.83;
            bValInt.height = 0.72;
            bValInt.name = "bIntField";
            bValInt.fontSize = buttonFontSize;
            bValInt.text = (currentColor.b * 255).toString();
            bValInt.color = inputTextColor;
            bValInt.background = inputTextBackgroundColor;
            bValInt.onFocusObservable.add(function () {
                activeField = bValInt.name;
                lastVal = bValInt.text;
                editSwatches(false);
            });
            bValInt.onBlurObservable.add(function () {
                if (bValInt.text == "") {
                    bValInt.text = "0";
                }
                updateInt(bValInt, "b");
                if (activeField == bValInt.name) {
                    activeField = "";
                }
            });
            bValInt.onTextChangedObservable.add(function () {
                if (activeField == bValInt.name) {
                    updateInt(bValInt, "b");
                }
            });
            rgbValuesQuadrant.addControl(bValInt, 2, 1);
            var rValDec = new _inputText__WEBPACK_IMPORTED_MODULE_3__.InputText();
            rValDec.width = 0.95;
            rValDec.height = 0.72;
            rValDec.name = "rDecField";
            rValDec.fontSize = buttonFontSize;
            rValDec.text = currentColor.r.toString();
            rValDec.color = inputTextColor;
            rValDec.background = inputTextBackgroundColor;
            rValDec.onFocusObservable.add(function () {
                activeField = rValDec.name;
                lastVal = rValDec.text;
                editSwatches(false);
            });
            rValDec.onBlurObservable.add(function () {
                if (parseFloat(rValDec.text) == 0 || rValDec.text == "") {
                    rValDec.text = "0";
                    updateFloat(rValDec, "r");
                }
                if (activeField == rValDec.name) {
                    activeField = "";
                }
            });
            rValDec.onTextChangedObservable.add(function () {
                if (activeField == rValDec.name) {
                    updateFloat(rValDec, "r");
                }
            });
            rgbValuesQuadrant.addControl(rValDec, 0, 2);
            var gValDec = new _inputText__WEBPACK_IMPORTED_MODULE_3__.InputText();
            gValDec.width = 0.95;
            gValDec.height = 0.72;
            gValDec.name = "gDecField";
            gValDec.fontSize = buttonFontSize;
            gValDec.text = currentColor.g.toString();
            gValDec.color = inputTextColor;
            gValDec.background = inputTextBackgroundColor;
            gValDec.onFocusObservable.add(function () {
                activeField = gValDec.name;
                lastVal = gValDec.text;
                editSwatches(false);
            });
            gValDec.onBlurObservable.add(function () {
                if (parseFloat(gValDec.text) == 0 || gValDec.text == "") {
                    gValDec.text = "0";
                    updateFloat(gValDec, "g");
                }
                if (activeField == gValDec.name) {
                    activeField = "";
                }
            });
            gValDec.onTextChangedObservable.add(function () {
                if (activeField == gValDec.name) {
                    updateFloat(gValDec, "g");
                }
            });
            rgbValuesQuadrant.addControl(gValDec, 1, 2);
            var bValDec = new _inputText__WEBPACK_IMPORTED_MODULE_3__.InputText();
            bValDec.width = 0.95;
            bValDec.height = 0.72;
            bValDec.name = "bDecField";
            bValDec.fontSize = buttonFontSize;
            bValDec.text = currentColor.b.toString();
            bValDec.color = inputTextColor;
            bValDec.background = inputTextBackgroundColor;
            bValDec.onFocusObservable.add(function () {
                activeField = bValDec.name;
                lastVal = bValDec.text;
                editSwatches(false);
            });
            bValDec.onBlurObservable.add(function () {
                if (parseFloat(bValDec.text) == 0 || bValDec.text == "") {
                    bValDec.text = "0";
                    updateFloat(bValDec, "b");
                }
                if (activeField == bValDec.name) {
                    activeField = "";
                }
            });
            bValDec.onTextChangedObservable.add(function () {
                if (activeField == bValDec.name) {
                    updateFloat(bValDec, "b");
                }
            });
            rgbValuesQuadrant.addControl(bValDec, 2, 2);
            // Hex value input
            var hexValueQuadrant = new _grid__WEBPACK_IMPORTED_MODULE_6__.Grid();
            hexValueQuadrant.name = "Hex Value";
            hexValueQuadrant.width = 0.82;
            hexValueQuadrant.addRowDefinition(1.0, false);
            hexValueQuadrant.addColumnDefinition(0.1, false);
            hexValueQuadrant.addColumnDefinition(0.9, false);
            pickerColorValues.addControl(hexValueQuadrant, 2, 0);
            var labelText = new _controls_textBlock__WEBPACK_IMPORTED_MODULE_7__.TextBlock();
            labelText.text = "#";
            labelText.color = buttonColor;
            labelText.fontSize = buttonFontSize;
            hexValueQuadrant.addControl(labelText, 0, 0);
            var hexVal = new _inputText__WEBPACK_IMPORTED_MODULE_3__.InputText();
            hexVal.width = 0.96;
            hexVal.height = 0.72;
            hexVal.name = "hexField";
            hexVal.horizontalAlignment = _control__WEBPACK_IMPORTED_MODULE_2__.Control.HORIZONTAL_ALIGNMENT_CENTER;
            hexVal.fontSize = buttonFontSize;
            var minusPound = options.lastColor.split("#");
            hexVal.text = minusPound[1];
            hexVal.color = inputTextColor;
            hexVal.background = inputTextBackgroundColor;
            hexVal.onFocusObservable.add(function () {
                activeField = hexVal.name;
                lastVal = hexVal.text;
                editSwatches(false);
            });
            hexVal.onBlurObservable.add(function () {
                if (hexVal.text.length == 3) {
                    var val = hexVal.text.split("");
                    hexVal.text = val[0] + val[0] + val[1] + val[1] + val[2] + val[2];
                }
                if (hexVal.text == "") {
                    hexVal.text = "000000";
                    updateValues(core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Color3.FromHexString(hexVal.text), "b");
                }
                if (activeField == hexVal.name) {
                    activeField = "";
                }
            });
            hexVal.onTextChangedObservable.add(function () {
                var newHexValue = hexVal.text;
                var checkHex = /[^0-9A-F]/i.test(newHexValue);
                if ((hexVal.text.length > 6 || checkHex) && activeField == hexVal.name) {
                    hexVal.text = lastVal;
                }
                else {
                    if (hexVal.text.length < 6) {
                        var leadingZero = 6 - hexVal.text.length;
                        for (var i = 0; i < leadingZero; i++) {
                            newHexValue = "0" + newHexValue;
                        }
                    }
                    if (hexVal.text.length == 3) {
                        var val = hexVal.text.split("");
                        newHexValue = val[0] + val[0] + val[1] + val[1] + val[2] + val[2];
                    }
                    newHexValue = "#" + newHexValue;
                    if (activeField == hexVal.name) {
                        lastVal = hexVal.text;
                        updateValues(core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Color3.FromHexString(newHexValue), hexVal.name);
                    }
                }
            });
            hexValueQuadrant.addControl(hexVal, 0, 1);
            if (options.savedColors && options.savedColors.length > 0) {
                updateSwatches("", butSave);
            }
            /**
             * Will update all values for InputText and ColorPicker controls based on the BABYLON.Color3 passed to this function.
             * Each InputText control and the ColorPicker control will be tested to see if they are the activeField and if they
             * are will receive no update. This is to prevent the input from the user being overwritten.
             * @param value
             * @param inputField
             */
            function updateValues(value, inputField) {
                activeField = inputField;
                var pickedColor = value.toHexString();
                newSwatch.background = pickedColor;
                if (rValInt.name != activeField) {
                    rValInt.text = Math.floor(value.r * 255).toString();
                }
                if (gValInt.name != activeField) {
                    gValInt.text = Math.floor(value.g * 255).toString();
                }
                if (bValInt.name != activeField) {
                    bValInt.text = Math.floor(value.b * 255).toString();
                }
                if (rValDec.name != activeField) {
                    rValDec.text = value.r.toString();
                }
                if (gValDec.name != activeField) {
                    gValDec.text = value.g.toString();
                }
                if (bValDec.name != activeField) {
                    bValDec.text = value.b.toString();
                }
                if (hexVal.name != activeField) {
                    var minusPound_1 = pickedColor.split("#");
                    hexVal.text = minusPound_1[1];
                }
                if (picker.name != activeField) {
                    picker.value = value;
                }
            }
            // When the user enters an integer for R, G, or B we check to make sure it is a valid number and replace if not.
            function updateInt(field, channel) {
                var newValue = field.text;
                var checkVal = /[^0-9]/g.test(newValue);
                if (checkVal) {
                    field.text = lastVal;
                    return;
                }
                else {
                    if (newValue != "") {
                        if (Math.floor(parseInt(newValue)) < 0) {
                            newValue = "0";
                        }
                        else if (Math.floor(parseInt(newValue)) > 255) {
                            newValue = "255";
                        }
                        else if (isNaN(parseInt(newValue))) {
                            newValue = "0";
                        }
                    }
                    if (activeField == field.name) {
                        lastVal = newValue;
                    }
                }
                if (newValue != "") {
                    newValue = parseInt(newValue).toString();
                    field.text = newValue;
                    var newSwatchRGB = core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Color3.FromHexString(newSwatch.background);
                    if (activeField == field.name) {
                        if (channel == "r") {
                            updateValues(new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Color3(parseInt(newValue) / 255, newSwatchRGB.g, newSwatchRGB.b), field.name);
                        }
                        else if (channel == "g") {
                            updateValues(new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Color3(newSwatchRGB.r, parseInt(newValue) / 255, newSwatchRGB.b), field.name);
                        }
                        else {
                            updateValues(new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Color3(newSwatchRGB.r, newSwatchRGB.g, parseInt(newValue) / 255), field.name);
                        }
                    }
                }
            }
            // When the user enters a float for R, G, or B we check to make sure it is a valid number and replace if not.
            function updateFloat(field, channel) {
                var newValue = field.text;
                var checkVal = /[^0-9.]/g.test(newValue);
                if (checkVal) {
                    field.text = lastVal;
                    return;
                }
                else {
                    if (newValue != "" && newValue != "." && parseFloat(newValue) != 0) {
                        if (parseFloat(newValue) < 0.0) {
                            newValue = "0.0";
                        }
                        else if (parseFloat(newValue) > 1.0) {
                            newValue = "1.0";
                        }
                        else if (isNaN(parseFloat(newValue))) {
                            newValue = "0.0";
                        }
                    }
                    if (activeField == field.name) {
                        lastVal = newValue;
                    }
                }
                if (newValue != "" && newValue != "." && parseFloat(newValue) != 0) {
                    newValue = parseFloat(newValue).toString();
                    field.text = newValue;
                }
                else {
                    newValue = "0.0";
                }
                var newSwatchRGB = core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Color3.FromHexString(newSwatch.background);
                if (activeField == field.name) {
                    if (channel == "r") {
                        updateValues(new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Color3(parseFloat(newValue), newSwatchRGB.g, newSwatchRGB.b), field.name);
                    }
                    else if (channel == "g") {
                        updateValues(new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Color3(newSwatchRGB.r, parseFloat(newValue), newSwatchRGB.b), field.name);
                    }
                    else {
                        updateValues(new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Color3(newSwatchRGB.r, newSwatchRGB.g, parseFloat(newValue)), field.name);
                    }
                }
            }
            // Removes the current index from the savedColors array. Drawer can then be regenerated.
            function deleteSwatch(index) {
                if (options.savedColors) {
                    options.savedColors.splice(index, 1);
                }
                if (options.savedColors && options.savedColors.length == 0) {
                    setEditButtonVisibility(false);
                    editSwatchMode = false;
                }
            }
            // Creates and styles an individual swatch when updateSwatches is called.
            function createSwatch() {
                if (options.savedColors && options.savedColors[swatchNumber]) {
                    var icon = void 0;
                    if (editSwatchMode) {
                        icon = "b";
                    }
                    else {
                        icon = "";
                    }
                    var swatch_1 = _button__WEBPACK_IMPORTED_MODULE_5__.Button.CreateSimpleButton("Swatch_" + swatchNumber, icon);
                    swatch_1.fontFamily = "coreglyphs";
                    var swatchColor = core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Color3.FromHexString(options.savedColors[swatchNumber]);
                    var swatchLuminence = swatchColor.r + swatchColor.g + swatchColor.b;
                    // Set color of outline and textBlock based on luminance of the color swatch so feedback always visible
                    if (swatchLuminence > luminanceLimit) {
                        swatch_1.color = iconColorDark;
                    }
                    else {
                        swatch_1.color = iconColorLight;
                    }
                    swatch_1.fontSize = Math.floor(swatchSize * 0.7);
                    swatch_1.textBlock.verticalAlignment = _control__WEBPACK_IMPORTED_MODULE_2__.Control.VERTICAL_ALIGNMENT_CENTER;
                    swatch_1.height = swatch_1.width = swatchSize.toString() + "px";
                    swatch_1.background = options.savedColors[swatchNumber];
                    swatch_1.thickness = 2;
                    var metadata_1 = swatchNumber;
                    swatch_1.pointerDownAnimation = function () {
                        swatch_1.thickness = 4;
                    };
                    swatch_1.pointerUpAnimation = function () {
                        swatch_1.thickness = 3;
                    };
                    swatch_1.pointerEnterAnimation = function () {
                        swatch_1.thickness = 3;
                    };
                    swatch_1.pointerOutAnimation = function () {
                        swatch_1.thickness = 2;
                    };
                    swatch_1.onPointerClickObservable.add(function () {
                        if (!editSwatchMode) {
                            if (options.savedColors) {
                                updateValues(core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Color3.FromHexString(options.savedColors[metadata_1]), swatch_1.name);
                            }
                        }
                        else {
                            deleteSwatch(metadata_1);
                            updateSwatches("", butSave);
                        }
                    });
                    return swatch_1;
                }
                else {
                    return null;
                }
            }
            // Mode switch to render button text and close symbols on swatch controls
            function editSwatches(mode) {
                if (mode !== undefined) {
                    editSwatchMode = mode;
                }
                var thisButton;
                if (editSwatchMode) {
                    for (var i = 0; i < swatchDrawer.children.length; i++) {
                        thisButton = swatchDrawer.children[i];
                        thisButton.textBlock.text = "b";
                    }
                    if (butEdit !== undefined) {
                        butEdit.textBlock.text = "Done";
                    }
                }
                else {
                    for (var i = 0; i < swatchDrawer.children.length; i++) {
                        thisButton = swatchDrawer.children[i];
                        thisButton.textBlock.text = "";
                    }
                    if (butEdit !== undefined) {
                        butEdit.textBlock.text = "Edit";
                    }
                }
            }
            /**
             * When Save Color button is pressed this function will first create a swatch drawer if one is not already
             * made. Then all controls are removed from the drawer and we step through the savedColors array and
             * creates one swatch per color. It will also set the height of the drawer control based on how many
             * saved colors there are and how many can be stored per row.
             * @param color
             * @param button
             */
            function updateSwatches(color, button) {
                if (options.savedColors) {
                    if (color != "") {
                        options.savedColors.push(color);
                    }
                    swatchNumber = 0;
                    swatchDrawer.clearControls();
                    var rowCount = Math.ceil(options.savedColors.length / options.numSwatchesPerLine);
                    var gutterCount = void 0;
                    if (rowCount == 0) {
                        gutterCount = 0;
                    }
                    else {
                        gutterCount = rowCount + 1;
                    }
                    if (swatchDrawer.rowCount != rowCount + gutterCount) {
                        var currentRows = swatchDrawer.rowCount;
                        for (var i = 0; i < currentRows; i++) {
                            swatchDrawer.removeRowDefinition(0);
                        }
                        for (var i = 0; i < rowCount + gutterCount; i++) {
                            if (i % 2) {
                                swatchDrawer.addRowDefinition(swatchSize, true);
                            }
                            else {
                                swatchDrawer.addRowDefinition(gutterSize, true);
                            }
                        }
                    }
                    swatchDrawer.height = (swatchSize * rowCount + gutterCount * gutterSize).toString() + "px";
                    for (var y = 1, thisRow = 1; y < rowCount + gutterCount; y += 2, thisRow++) {
                        // Determine number of buttons to create per row based on the button limit per row and number of saved colors
                        var totalButtonsThisRow = void 0;
                        if (options.savedColors.length > thisRow * options.numSwatchesPerLine) {
                            totalButtonsThisRow = options.numSwatchesPerLine;
                        }
                        else {
                            totalButtonsThisRow = options.savedColors.length - (thisRow - 1) * options.numSwatchesPerLine;
                        }
                        var buttonIterations = Math.min(Math.max(totalButtonsThisRow, 0), options.numSwatchesPerLine);
                        for (var x = 0, w = 1; x < buttonIterations; x++) {
                            if (x > options.numSwatchesPerLine) {
                                continue;
                            }
                            var swatch = createSwatch();
                            if (swatch != null) {
                                swatchDrawer.addControl(swatch, y, w);
                                w += 2;
                                swatchNumber++;
                            }
                            else {
                                continue;
                            }
                        }
                    }
                    if (options.savedColors.length >= options.swatchLimit) {
                        disableButton(button, true);
                    }
                    else {
                        disableButton(button, false);
                    }
                }
            }
            // Shows or hides edit swatches button depending on if there are saved swatches
            function setEditButtonVisibility(enableButton) {
                if (enableButton) {
                    butEdit = _button__WEBPACK_IMPORTED_MODULE_5__.Button.CreateSimpleButton("butEdit", "Edit");
                    butEdit.width = buttonWidth;
                    butEdit.height = buttonHeight;
                    butEdit.left = Math.floor(parseInt(buttonWidth) * 0.1).toString() + "px";
                    butEdit.top = (parseFloat(butEdit.left) * -1).toString() + "px";
                    butEdit.verticalAlignment = _control__WEBPACK_IMPORTED_MODULE_2__.Control.VERTICAL_ALIGNMENT_BOTTOM;
                    butEdit.horizontalAlignment = _control__WEBPACK_IMPORTED_MODULE_2__.Control.HORIZONTAL_ALIGNMENT_LEFT;
                    butEdit.thickness = 2;
                    butEdit.color = buttonColor;
                    butEdit.fontSize = buttonFontSize;
                    butEdit.background = buttonBackgroundColor;
                    butEdit.onPointerEnterObservable.add(function () {
                        butEdit.background = buttonBackgroundHoverColor;
                    });
                    butEdit.onPointerOutObservable.add(function () {
                        butEdit.background = buttonBackgroundColor;
                    });
                    butEdit.pointerDownAnimation = function () {
                        butEdit.background = buttonBackgroundClickColor;
                    };
                    butEdit.pointerUpAnimation = function () {
                        butEdit.background = buttonBackgroundHoverColor;
                    };
                    butEdit.onPointerClickObservable.add(function () {
                        if (editSwatchMode) {
                            editSwatchMode = false;
                        }
                        else {
                            editSwatchMode = true;
                        }
                        editSwatches();
                    });
                    pickerGrid.addControl(butEdit, 1, 0);
                }
                else {
                    pickerGrid.removeControl(butEdit);
                }
            }
            // Called when the user hits the limit of saved colors in the drawer.
            function disableButton(button, disabled) {
                if (disabled) {
                    button.color = buttonDisabledColor;
                    button.background = buttonDisabledBackgroundColor;
                }
                else {
                    button.color = buttonColor;
                    button.background = buttonBackgroundColor;
                }
            }
            // Passes last chosen color back to scene and kills dialog by removing from AdvancedDynamicTexture
            function closePicker(color) {
                if (options.savedColors && options.savedColors.length > 0) {
                    resolve({
                        savedColors: options.savedColors,
                        pickedColor: color,
                    });
                }
                else {
                    resolve({
                        pickedColor: color,
                    });
                }
                advancedTexture.removeControl(dialogContainer);
            }
        });
    };
    ColorPicker._Epsilon = 0.000001;
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], ColorPicker.prototype, "value", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], ColorPicker.prototype, "width", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], ColorPicker.prototype, "height", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], ColorPicker.prototype, "size", null);
    return ColorPicker;
}(_control__WEBPACK_IMPORTED_MODULE_2__.Control));

(0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.RegisterClass)("BABYLON.GUI.ColorPicker", ColorPicker);


/***/ }),

/***/ "../../../lts/gui/dist/2D/controls/container.js":
/*!******************************************************!*\
  !*** ../../../lts/gui/dist/2D/controls/container.js ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Container": () => (/* binding */ Container)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Misc_logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Engines/constants */ "core/Misc/observable");
/* harmony import */ var core_Misc_logger__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Misc_logger__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./control */ "../../../lts/gui/dist/2D/controls/control.js");
/* harmony import */ var _measure__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../measure */ "../../../lts/gui/dist/2D/measure.js");









/**
 * Root class for 2D containers
 * @see https://doc.babylonjs.com/how_to/gui#containers
 */
var Container = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(Container, _super);
    /**
     * Creates a new Container
     * @param name defines the name of the container
     */
    function Container(name) {
        var _this = _super.call(this, name) || this;
        _this.name = name;
        /** @hidden */
        _this._children = new Array();
        /** @hidden */
        _this._measureForChildren = _measure__WEBPACK_IMPORTED_MODULE_3__.Measure.Empty();
        /** @hidden */
        _this._background = "";
        /** @hidden */
        _this._adaptWidthToChildren = false;
        /** @hidden */
        _this._adaptHeightToChildren = false;
        /** @hidden */
        _this._renderToIntermediateTexture = false;
        /** @hidden */
        _this._intermediateTexture = null;
        /**
         * Gets or sets a boolean indicating that layout cycle errors should be displayed on the console
         */
        _this.logLayoutCycleErrors = false;
        /**
         * Gets or sets the number of layout cycles (a change involved by a control while evaluating the layout) allowed
         */
        _this.maxLayoutCycle = 3;
        return _this;
    }
    Object.defineProperty(Container.prototype, "renderToIntermediateTexture", {
        /** Gets or sets boolean indicating if children should be rendered to an intermediate texture rather than directly to host, useful for alpha blending */
        get: function () {
            return this._renderToIntermediateTexture;
        },
        set: function (value) {
            if (this._renderToIntermediateTexture === value) {
                return;
            }
            this._renderToIntermediateTexture = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Container.prototype, "adaptHeightToChildren", {
        /** Gets or sets a boolean indicating if the container should try to adapt to its children height */
        get: function () {
            return this._adaptHeightToChildren;
        },
        set: function (value) {
            if (this._adaptHeightToChildren === value) {
                return;
            }
            this._adaptHeightToChildren = value;
            if (value) {
                this.height = "100%";
            }
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Container.prototype, "adaptWidthToChildren", {
        /** Gets or sets a boolean indicating if the container should try to adapt to its children width */
        get: function () {
            return this._adaptWidthToChildren;
        },
        set: function (value) {
            if (this._adaptWidthToChildren === value) {
                return;
            }
            this._adaptWidthToChildren = value;
            if (value) {
                this.width = "100%";
            }
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Container.prototype, "background", {
        /** Gets or sets background color */
        get: function () {
            return this._background;
        },
        set: function (value) {
            if (this._background === value) {
                return;
            }
            this._background = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Container.prototype, "children", {
        /** Gets the list of children */
        get: function () {
            return this._children;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Container.prototype, "isReadOnly", {
        get: function () {
            return this._isReadOnly;
        },
        set: function (value) {
            this._isReadOnly = value;
            for (var _i = 0, _a = this._children; _i < _a.length; _i++) {
                var child = _a[_i];
                child.isReadOnly = value;
            }
        },
        enumerable: false,
        configurable: true
    });
    Container.prototype._getTypeName = function () {
        return "Container";
    };
    Container.prototype._flagDescendantsAsMatrixDirty = function () {
        for (var _i = 0, _a = this.children; _i < _a.length; _i++) {
            var child = _a[_i];
            child._markMatrixAsDirty();
        }
    };
    /**
     * Gets a child using its name
     * @param name defines the child name to look for
     * @returns the child control if found
     */
    Container.prototype.getChildByName = function (name) {
        for (var _i = 0, _a = this.children; _i < _a.length; _i++) {
            var child = _a[_i];
            if (child.name === name) {
                return child;
            }
        }
        return null;
    };
    /**
     * Gets a child using its type and its name
     * @param name defines the child name to look for
     * @param type defines the child type to look for
     * @returns the child control if found
     */
    Container.prototype.getChildByType = function (name, type) {
        for (var _i = 0, _a = this.children; _i < _a.length; _i++) {
            var child = _a[_i];
            if (child.typeName === type) {
                return child;
            }
        }
        return null;
    };
    /**
     * Search for a specific control in children
     * @param control defines the control to look for
     * @returns true if the control is in child list
     */
    Container.prototype.containsControl = function (control) {
        return this.children.indexOf(control) !== -1;
    };
    /**
     * Adds a new control to the current container
     * @param control defines the control to add
     * @returns the current container
     */
    Container.prototype.addControl = function (control) {
        if (!control) {
            return this;
        }
        var index = this._children.indexOf(control);
        if (index !== -1) {
            return this;
        }
        control._link(this._host);
        control._markAllAsDirty();
        this._reOrderControl(control);
        this._markAsDirty();
        return this;
    };
    /**
     * Removes all controls from the current container
     * @returns the current container
     */
    Container.prototype.clearControls = function () {
        var children = this.children.slice();
        for (var _i = 0, children_1 = children; _i < children_1.length; _i++) {
            var child = children_1[_i];
            this.removeControl(child);
        }
        return this;
    };
    /**
     * Removes a control from the current container
     * @param control defines the control to remove
     * @returns the current container
     */
    Container.prototype.removeControl = function (control) {
        var index = this._children.indexOf(control);
        if (index !== -1) {
            this._children.splice(index, 1);
            control.parent = null;
        }
        control.linkWithMesh(null);
        if (this._host) {
            this._host._cleanControlAfterRemoval(control);
        }
        this._markAsDirty();
        return this;
    };
    /**
     * @param control
     * @hidden
     */
    Container.prototype._reOrderControl = function (control) {
        this.removeControl(control);
        var wasAdded = false;
        for (var index = 0; index < this._children.length; index++) {
            if (this._children[index].zIndex > control.zIndex) {
                this._children.splice(index, 0, control);
                wasAdded = true;
                break;
            }
        }
        if (!wasAdded) {
            this._children.push(control);
        }
        control.parent = this;
        this._markAsDirty();
    };
    /**
     * @param offset
     * @hidden
     */
    Container.prototype._offsetLeft = function (offset) {
        _super.prototype._offsetLeft.call(this, offset);
        for (var _i = 0, _a = this._children; _i < _a.length; _i++) {
            var child = _a[_i];
            child._offsetLeft(offset);
        }
    };
    /**
     * @param offset
     * @hidden
     */
    Container.prototype._offsetTop = function (offset) {
        _super.prototype._offsetTop.call(this, offset);
        for (var _i = 0, _a = this._children; _i < _a.length; _i++) {
            var child = _a[_i];
            child._offsetTop(offset);
        }
    };
    /** @hidden */
    Container.prototype._markAllAsDirty = function () {
        _super.prototype._markAllAsDirty.call(this);
        for (var index = 0; index < this._children.length; index++) {
            this._children[index]._markAllAsDirty();
        }
    };
    /**
     * @param context
     * @hidden
     */
    Container.prototype._localDraw = function (context) {
        if (this._background) {
            context.save();
            if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
                context.shadowColor = this.shadowColor;
                context.shadowBlur = this.shadowBlur;
                context.shadowOffsetX = this.shadowOffsetX;
                context.shadowOffsetY = this.shadowOffsetY;
            }
            context.fillStyle = this._background;
            context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);
            context.restore();
        }
    };
    /**
     * @param host
     * @hidden
     */
    Container.prototype._link = function (host) {
        _super.prototype._link.call(this, host);
        for (var _i = 0, _a = this._children; _i < _a.length; _i++) {
            var child = _a[_i];
            child._link(host);
        }
    };
    /** @hidden */
    Container.prototype._beforeLayout = function () {
        // Do nothing
    };
    /**
     * @param parentMeasure
     * @param context
     * @hidden
     */
    Container.prototype._processMeasures = function (parentMeasure, context) {
        if (this._isDirty || !this._cachedParentMeasure.isEqualsTo(parentMeasure)) {
            _super.prototype._processMeasures.call(this, parentMeasure, context);
            this._evaluateClippingState(parentMeasure);
            if (this._renderToIntermediateTexture) {
                if (this._intermediateTexture && this._host.getScene() != this._intermediateTexture.getScene()) {
                    this._intermediateTexture.dispose();
                    this._intermediateTexture = null;
                }
                if (!this._intermediateTexture) {
                    this._intermediateTexture = new core_Misc_logger__WEBPACK_IMPORTED_MODULE_1__.DynamicTexture("", { width: this._currentMeasure.width, height: this._currentMeasure.height }, this._host.getScene(), false, core_Misc_logger__WEBPACK_IMPORTED_MODULE_1__.Texture.NEAREST_SAMPLINGMODE, core_Misc_logger__WEBPACK_IMPORTED_MODULE_1__.Constants.TEXTUREFORMAT_RGBA, false);
                    this._intermediateTexture.hasAlpha = true;
                }
                else {
                    this._intermediateTexture.scaleTo(this._currentMeasure.width, this._currentMeasure.height);
                }
            }
        }
    };
    /**
     * @param parentMeasure
     * @param context
     * @hidden
     */
    Container.prototype._layout = function (parentMeasure, context) {
        var _a, _b;
        if (!this.isDirty && (!this.isVisible || this.notRenderable)) {
            return false;
        }
        this.host._numLayoutCalls++;
        if (this._isDirty) {
            this._currentMeasure.transformToRef(this._transformMatrix, this._prevCurrentMeasureTransformedIntoGlobalSpace);
        }
        var rebuildCount = 0;
        context.save();
        this._applyStates(context);
        this._beforeLayout();
        do {
            var computedWidth = -1;
            var computedHeight = -1;
            this._rebuildLayout = false;
            this._processMeasures(parentMeasure, context);
            if (!this._isClipped) {
                for (var _i = 0, _c = this._children; _i < _c.length; _i++) {
                    var child = _c[_i];
                    child._tempParentMeasure.copyFrom(this._measureForChildren);
                    if (child._layout(this._measureForChildren, context)) {
                        if (child.isVisible && !child.notRenderable) {
                            if (this.adaptWidthToChildren && child._width.isPixel) {
                                computedWidth = Math.max(computedWidth, child._currentMeasure.width + child._paddingLeftInPixels + child._paddingRightInPixels);
                            }
                            if (this.adaptHeightToChildren && child._height.isPixel) {
                                computedHeight = Math.max(computedHeight, child._currentMeasure.height + child._paddingTopInPixels + child._paddingBottomInPixels);
                            }
                        }
                    }
                }
                if (this.adaptWidthToChildren && computedWidth >= 0) {
                    computedWidth += this.paddingLeftInPixels + this.paddingRightInPixels;
                    if (this.width !== computedWidth + "px") {
                        (_a = this.parent) === null || _a === void 0 ? void 0 : _a._markAsDirty();
                        this.width = computedWidth + "px";
                        this._width.ignoreAdaptiveScaling = true;
                        this._rebuildLayout = true;
                    }
                }
                if (this.adaptHeightToChildren && computedHeight >= 0) {
                    computedHeight += this.paddingTopInPixels + this.paddingBottomInPixels;
                    if (this.height !== computedHeight + "px") {
                        (_b = this.parent) === null || _b === void 0 ? void 0 : _b._markAsDirty();
                        this.height = computedHeight + "px";
                        this._height.ignoreAdaptiveScaling = true;
                        this._rebuildLayout = true;
                    }
                }
                this._postMeasure();
            }
            rebuildCount++;
        } while (this._rebuildLayout && rebuildCount < this.maxLayoutCycle);
        if (rebuildCount >= 3 && this.logLayoutCycleErrors) {
            core_Misc_logger__WEBPACK_IMPORTED_MODULE_1__.Logger.Error("Layout cycle detected in GUI (Container name=".concat(this.name, ", uniqueId=").concat(this.uniqueId, ")"));
        }
        context.restore();
        if (this._isDirty) {
            this.invalidateRect();
            this._isDirty = false;
        }
        return true;
    };
    Container.prototype._postMeasure = function () {
        // Do nothing by default
    };
    /**
     * @param context
     * @param invalidatedRectangle
     * @hidden
     */
    Container.prototype._draw = function (context, invalidatedRectangle) {
        var renderToIntermediateTextureThisDraw = this._renderToIntermediateTexture && this._intermediateTexture;
        var contextToDrawTo = renderToIntermediateTextureThisDraw ? this._intermediateTexture.getContext() : context;
        if (renderToIntermediateTextureThisDraw) {
            contextToDrawTo.save();
            contextToDrawTo.translate(-this._currentMeasure.left, -this._currentMeasure.top);
            if (invalidatedRectangle) {
                contextToDrawTo.clearRect(invalidatedRectangle.left, invalidatedRectangle.top, invalidatedRectangle.width, invalidatedRectangle.height);
            }
            else {
                contextToDrawTo.clearRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);
            }
        }
        this._localDraw(contextToDrawTo);
        context.save();
        if (this.clipChildren) {
            this._clipForChildren(contextToDrawTo);
        }
        for (var _i = 0, _a = this._children; _i < _a.length; _i++) {
            var child = _a[_i];
            // Only redraw parts of the screen that are invalidated
            if (invalidatedRectangle) {
                if (!child._intersectsRect(invalidatedRectangle)) {
                    continue;
                }
            }
            child._render(contextToDrawTo, invalidatedRectangle);
        }
        if (renderToIntermediateTextureThisDraw) {
            contextToDrawTo.restore();
            context.save();
            context.globalAlpha = this.alpha;
            context.drawImage(contextToDrawTo.canvas, this._currentMeasure.left, this._currentMeasure.top);
            context.restore();
        }
        context.restore();
    };
    Container.prototype.getDescendantsToRef = function (results, directDescendantsOnly, predicate) {
        if (directDescendantsOnly === void 0) { directDescendantsOnly = false; }
        if (!this.children) {
            return;
        }
        for (var index = 0; index < this.children.length; index++) {
            var item = this.children[index];
            if (!predicate || predicate(item)) {
                results.push(item);
            }
            if (!directDescendantsOnly) {
                item.getDescendantsToRef(results, false, predicate);
            }
        }
    };
    /**
     * @param x
     * @param y
     * @param pi
     * @param type
     * @param pointerId
     * @param buttonIndex
     * @param deltaX
     * @param deltaY
     * @hidden
     */
    Container.prototype._processPicking = function (x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY) {
        if (!this._isEnabled || !this.isVisible || this.notRenderable) {
            return false;
        }
        // checks if the picking position is within the container
        var contains = _super.prototype.contains.call(this, x, y);
        // if clipChildren is off, we should still pass picking events to children even if we don't contain the pointer
        if (!contains && this.clipChildren) {
            return false;
        }
        // Checking backwards to pick closest first
        for (var index = this._children.length - 1; index >= 0; index--) {
            var child = this._children[index];
            if (child._processPicking(x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY)) {
                if (child.hoverCursor) {
                    this._host._changeCursor(child.hoverCursor);
                }
                return true;
            }
        }
        if (!contains) {
            return false;
        }
        if (!this.isHitTestVisible) {
            return false;
        }
        return this._processObservables(type, x, y, pi, pointerId, buttonIndex, deltaX, deltaY);
    };
    /**
     * @param parentMeasure
     * @param context
     * @hidden
     */
    Container.prototype._additionalProcessing = function (parentMeasure, context) {
        _super.prototype._additionalProcessing.call(this, parentMeasure, context);
        this._measureForChildren.copyFrom(this._currentMeasure);
    };
    /**
     * Serializes the current control
     * @param serializationObject defined the JSON serialized object
     */
    Container.prototype.serialize = function (serializationObject) {
        _super.prototype.serialize.call(this, serializationObject);
        if (!this.children.length) {
            return;
        }
        serializationObject.children = [];
        for (var _i = 0, _a = this.children; _i < _a.length; _i++) {
            var child = _a[_i];
            var childSerializationObject = {};
            child.serialize(childSerializationObject);
            serializationObject.children.push(childSerializationObject);
        }
    };
    /** Releases associated resources */
    Container.prototype.dispose = function () {
        var _a;
        _super.prototype.dispose.call(this);
        for (var index = this.children.length - 1; index >= 0; index--) {
            this.children[index].dispose();
        }
        (_a = this._intermediateTexture) === null || _a === void 0 ? void 0 : _a.dispose();
    };
    /**
     * @param serializedObject
     * @param host
     * @hidden
     */
    Container.prototype._parseFromContent = function (serializedObject, host) {
        _super.prototype._parseFromContent.call(this, serializedObject, host);
        this._link(host);
        if (!serializedObject.children) {
            return;
        }
        for (var _i = 0, _a = serializedObject.children; _i < _a.length; _i++) {
            var childData = _a[_i];
            this.addControl(_control__WEBPACK_IMPORTED_MODULE_2__.Control.Parse(childData, host));
        }
    };
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_logger__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Container.prototype, "renderToIntermediateTexture", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_logger__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Container.prototype, "maxLayoutCycle", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_logger__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Container.prototype, "adaptHeightToChildren", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_logger__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Container.prototype, "adaptWidthToChildren", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_logger__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Container.prototype, "background", null);
    return Container;
}(_control__WEBPACK_IMPORTED_MODULE_2__.Control));

(0,core_Misc_logger__WEBPACK_IMPORTED_MODULE_1__.RegisterClass)("BABYLON.GUI.Container", Container);


/***/ }),

/***/ "../../../lts/gui/dist/2D/controls/control.js":
/*!****************************************************!*\
  !*** ../../../lts/gui/dist/2D/controls/control.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Control": () => (/* binding */ Control)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Engines/engineStore */ "core/Misc/observable");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _valueAndUnit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../valueAndUnit */ "../../../lts/gui/dist/2D/valueAndUnit.js");
/* harmony import */ var _measure__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../measure */ "../../../lts/gui/dist/2D/measure.js");
/* harmony import */ var _math2D__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../math2D */ "../../../lts/gui/dist/2D/math2D.js");












/**
 * Root class used for all 2D controls
 * @see https://doc.babylonjs.com/how_to/gui#controls
 */
var Control = /** @class */ (function () {
    // Functions
    /**
     * Creates a new control
     * @param name defines the name of the control
     */
    function Control(
    /** defines the name of the control */
    name) {
        this.name = name;
        this._alpha = 1;
        this._alphaSet = false;
        this._zIndex = 0;
        /** @hidden */
        this._currentMeasure = _measure__WEBPACK_IMPORTED_MODULE_3__.Measure.Empty();
        /** @hidden */
        this._tempPaddingMeasure = _measure__WEBPACK_IMPORTED_MODULE_3__.Measure.Empty();
        this._fontFamily = "Arial";
        this._fontStyle = "";
        this._fontWeight = "";
        this._fontSize = new _valueAndUnit__WEBPACK_IMPORTED_MODULE_2__.ValueAndUnit(18, _valueAndUnit__WEBPACK_IMPORTED_MODULE_2__.ValueAndUnit.UNITMODE_PIXEL, false);
        /** @hidden */
        this._width = new _valueAndUnit__WEBPACK_IMPORTED_MODULE_2__.ValueAndUnit(1, _valueAndUnit__WEBPACK_IMPORTED_MODULE_2__.ValueAndUnit.UNITMODE_PERCENTAGE, false);
        /** @hidden */
        this._height = new _valueAndUnit__WEBPACK_IMPORTED_MODULE_2__.ValueAndUnit(1, _valueAndUnit__WEBPACK_IMPORTED_MODULE_2__.ValueAndUnit.UNITMODE_PERCENTAGE, false);
        this._color = "";
        this._style = null;
        /** @hidden */
        this._horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_CENTER;
        /** @hidden */
        this._verticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER;
        /** @hidden */
        this._isDirty = true;
        /** @hidden */
        this._wasDirty = false;
        /** @hidden */
        this._tempParentMeasure = _measure__WEBPACK_IMPORTED_MODULE_3__.Measure.Empty();
        /** @hidden */
        this._prevCurrentMeasureTransformedIntoGlobalSpace = _measure__WEBPACK_IMPORTED_MODULE_3__.Measure.Empty();
        /** @hidden */
        this._cachedParentMeasure = _measure__WEBPACK_IMPORTED_MODULE_3__.Measure.Empty();
        this._descendantsOnlyPadding = false;
        this._paddingLeft = new _valueAndUnit__WEBPACK_IMPORTED_MODULE_2__.ValueAndUnit(0);
        this._paddingRight = new _valueAndUnit__WEBPACK_IMPORTED_MODULE_2__.ValueAndUnit(0);
        this._paddingTop = new _valueAndUnit__WEBPACK_IMPORTED_MODULE_2__.ValueAndUnit(0);
        this._paddingBottom = new _valueAndUnit__WEBPACK_IMPORTED_MODULE_2__.ValueAndUnit(0);
        /** @hidden */
        this._left = new _valueAndUnit__WEBPACK_IMPORTED_MODULE_2__.ValueAndUnit(0);
        /** @hidden */
        this._top = new _valueAndUnit__WEBPACK_IMPORTED_MODULE_2__.ValueAndUnit(0);
        this._scaleX = 1.0;
        this._scaleY = 1.0;
        this._rotation = 0;
        this._transformCenterX = 0.5;
        this._transformCenterY = 0.5;
        /** @hidden */
        this._transformMatrix = _math2D__WEBPACK_IMPORTED_MODULE_4__.Matrix2D.Identity();
        /** @hidden */
        this._invertTransformMatrix = _math2D__WEBPACK_IMPORTED_MODULE_4__.Matrix2D.Identity();
        /** @hidden */
        this._transformedPosition = core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Vector2.Zero();
        this._isMatrixDirty = true;
        this._isVisible = true;
        this._isHighlighted = false;
        this._highlightColor = "#4affff";
        this._highlightLineWidth = 2;
        this._fontSet = false;
        this._dummyVector2 = core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Vector2.Zero();
        this._downCount = 0;
        this._enterCount = -1;
        this._doNotRender = false;
        this._downPointerIds = {};
        this._evaluatedMeasure = new _measure__WEBPACK_IMPORTED_MODULE_3__.Measure(0, 0, 0, 0);
        this._evaluatedParentMeasure = new _measure__WEBPACK_IMPORTED_MODULE_3__.Measure(0, 0, 0, 0);
        this._isEnabled = true;
        this._disabledColor = "#9a9a9a";
        this._disabledColorItem = "#6a6a6a";
        this._isReadOnly = false;
        /** @hidden */
        this._rebuildLayout = false;
        /** @hidden */
        this._customData = {};
        /** @hidden */
        this._isClipped = false;
        /** @hidden */
        this._automaticSize = false;
        /**
         * Gets or sets an object used to store user defined information for the node
         */
        this.metadata = null;
        /** Gets or sets a boolean indicating if the control can be hit with pointer events */
        this.isHitTestVisible = true;
        /** Gets or sets a boolean indicating if the control can block pointer events */
        this.isPointerBlocker = false;
        /** Gets or sets a boolean indicating if the control can be focusable */
        this.isFocusInvisible = false;
        /**
         * Gets or sets a boolean indicating if the children are clipped to the current control bounds.
         * Please note that not clipping children may generate issues with adt.useInvalidateRectOptimization so it is recommended to turn this optimization off if you want to use unclipped children
         */
        this.clipChildren = true;
        /**
         * Gets or sets a boolean indicating that control content must be clipped
         * Please note that not clipping children may generate issues with adt.useInvalidateRectOptimization so it is recommended to turn this optimization off if you want to use unclipped children
         */
        this.clipContent = true;
        /**
         * Gets or sets a boolean indicating that the current control should cache its rendering (useful when the control does not change often)
         */
        this.useBitmapCache = false;
        this._shadowOffsetX = 0;
        this._shadowOffsetY = 0;
        this._shadowBlur = 0;
        this._previousShadowBlur = 0;
        this._shadowColor = "black";
        /** Gets or sets the cursor to use when the control is hovered */
        this.hoverCursor = "";
        /** @hidden */
        this._linkOffsetX = new _valueAndUnit__WEBPACK_IMPORTED_MODULE_2__.ValueAndUnit(0);
        /** @hidden */
        this._linkOffsetY = new _valueAndUnit__WEBPACK_IMPORTED_MODULE_2__.ValueAndUnit(0);
        /**
         * An event triggered when pointer wheel is scrolled
         */
        this.onWheelObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        /**
         * An event triggered when the pointer moves over the control.
         */
        this.onPointerMoveObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        /**
         * An event triggered when the pointer moves out of the control.
         */
        this.onPointerOutObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        /**
         * An event triggered when the pointer taps the control
         */
        this.onPointerDownObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        /**
         * An event triggered when pointer up
         */
        this.onPointerUpObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        /**
         * An event triggered when a control is clicked on
         */
        this.onPointerClickObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        /**
         * An event triggered when pointer enters the control
         */
        this.onPointerEnterObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        /**
         * An event triggered when the control is marked as dirty
         */
        this.onDirtyObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        /**
         * An event triggered before drawing the control
         */
        this.onBeforeDrawObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        /**
         * An event triggered after the control was drawn
         */
        this.onAfterDrawObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        /**
         * An event triggered when the control has been disposed
         */
        this.onDisposeObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        /**
         * Gets or sets a fixed ratio for this control.
         * When different from 0, the ratio is used to compute the "second" dimension.
         * The first dimension used in the computation is the last one set (by setting width / widthInPixels or height / heightInPixels), and the
         * second dimension is computed as first dimension * fixedRatio
         */
        this.fixedRatio = 0;
        this._fixedRatioMasterIsWidth = true;
        this._tmpMeasureA = new _measure__WEBPACK_IMPORTED_MODULE_3__.Measure(0, 0, 0, 0);
    }
    Object.defineProperty(Control.prototype, "isReadOnly", {
        /**
         * Gets or sets a boolean indicating if the control is readonly (default: false).
         * A readonly control will still raise pointer events but will not react to them
         */
        get: function () {
            return this._isReadOnly;
        },
        set: function (value) {
            this._isReadOnly = value;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "transformedMeasure", {
        /**
         * Gets the transformed measure, that is the bounding box of the control after applying all transformations
         */
        get: function () {
            return this._evaluatedMeasure;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "shadowOffsetX", {
        /** Gets or sets a value indicating the offset to apply on X axis to render the shadow */
        get: function () {
            return this._shadowOffsetX;
        },
        set: function (value) {
            if (this._shadowOffsetX === value) {
                return;
            }
            this._shadowOffsetX = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "shadowOffsetY", {
        /** Gets or sets a value indicating the offset to apply on Y axis to render the shadow */
        get: function () {
            return this._shadowOffsetY;
        },
        set: function (value) {
            if (this._shadowOffsetY === value) {
                return;
            }
            this._shadowOffsetY = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "shadowBlur", {
        /** Gets or sets a value indicating the amount of blur to use to render the shadow */
        get: function () {
            return this._shadowBlur;
        },
        set: function (value) {
            if (this._shadowBlur === value) {
                return;
            }
            this._previousShadowBlur = this._shadowBlur;
            this._shadowBlur = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "shadowColor", {
        /** Gets or sets a value indicating the color of the shadow (black by default ie. "#000") */
        get: function () {
            return this._shadowColor;
        },
        set: function (value) {
            if (this._shadowColor === value) {
                return;
            }
            this._shadowColor = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "typeName", {
        // Properties
        /** Gets the control type name */
        get: function () {
            return this._getTypeName();
        },
        enumerable: false,
        configurable: true
    });
    /**
     * Get the current class name of the control.
     * @returns current class name
     */
    Control.prototype.getClassName = function () {
        return this._getTypeName();
    };
    Object.defineProperty(Control.prototype, "host", {
        /**
         * Get the hosting AdvancedDynamicTexture
         */
        get: function () {
            return this._host;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "fontOffset", {
        /** Gets or set information about font offsets (used to render and align text) */
        get: function () {
            return this._fontOffset;
        },
        set: function (offset) {
            this._fontOffset = offset;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "alpha", {
        /** Gets or sets alpha value for the control (1 means opaque and 0 means entirely transparent) */
        get: function () {
            return this._alpha;
        },
        set: function (value) {
            if (this._alpha === value) {
                return;
            }
            this._alphaSet = true;
            this._alpha = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "highlightLineWidth", {
        /**
         * Gets or sets a number indicating size of stroke we want to highlight the control with (mostly for debugging purpose)
         */
        get: function () {
            return this._highlightLineWidth;
        },
        set: function (value) {
            if (this._highlightLineWidth === value) {
                return;
            }
            this._highlightLineWidth = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "isHighlighted", {
        /**
         * Gets or sets a boolean indicating that we want to highlight the control (mostly for debugging purpose)
         */
        get: function () {
            return this._isHighlighted;
        },
        set: function (value) {
            if (this._isHighlighted === value) {
                return;
            }
            this._isHighlighted = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "highlightColor", {
        /**
         * Gets or sets a string defining the color to use for highlighting this control
         */
        get: function () {
            return this._highlightColor;
        },
        set: function (value) {
            if (this._highlightColor === value) {
                return;
            }
            this._highlightColor = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "scaleX", {
        /** Gets or sets a value indicating the scale factor on X axis (1 by default)
         * @see https://doc.babylonjs.com/how_to/gui#rotation-and-scaling
         */
        get: function () {
            return this._scaleX;
        },
        set: function (value) {
            if (this._scaleX === value) {
                return;
            }
            this._scaleX = value;
            this._markAsDirty();
            this._markMatrixAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "scaleY", {
        /** Gets or sets a value indicating the scale factor on Y axis (1 by default)
         * @see https://doc.babylonjs.com/how_to/gui#rotation-and-scaling
         */
        get: function () {
            return this._scaleY;
        },
        set: function (value) {
            if (this._scaleY === value) {
                return;
            }
            this._scaleY = value;
            this._markAsDirty();
            this._markMatrixAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "rotation", {
        /** Gets or sets the rotation angle (0 by default)
         * @see https://doc.babylonjs.com/how_to/gui#rotation-and-scaling
         */
        get: function () {
            return this._rotation;
        },
        set: function (value) {
            if (this._rotation === value) {
                return;
            }
            this._rotation = value;
            this._markAsDirty();
            this._markMatrixAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "transformCenterY", {
        /** Gets or sets the transformation center on Y axis (0 by default)
         * @see https://doc.babylonjs.com/how_to/gui#rotation-and-scaling
         */
        get: function () {
            return this._transformCenterY;
        },
        set: function (value) {
            if (this._transformCenterY === value) {
                return;
            }
            this._transformCenterY = value;
            this._markAsDirty();
            this._markMatrixAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "transformCenterX", {
        /** Gets or sets the transformation center on X axis (0 by default)
         * @see https://doc.babylonjs.com/how_to/gui#rotation-and-scaling
         */
        get: function () {
            return this._transformCenterX;
        },
        set: function (value) {
            if (this._transformCenterX === value) {
                return;
            }
            this._transformCenterX = value;
            this._markAsDirty();
            this._markMatrixAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "horizontalAlignment", {
        /**
         * Gets or sets the horizontal alignment
         * @see https://doc.babylonjs.com/how_to/gui#alignments
         */
        get: function () {
            return this._horizontalAlignment;
        },
        set: function (value) {
            if (this._horizontalAlignment === value) {
                return;
            }
            this._horizontalAlignment = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "verticalAlignment", {
        /**
         * Gets or sets the vertical alignment
         * @see https://doc.babylonjs.com/how_to/gui#alignments
         */
        get: function () {
            return this._verticalAlignment;
        },
        set: function (value) {
            if (this._verticalAlignment === value) {
                return;
            }
            this._verticalAlignment = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "width", {
        /**
         * Gets or sets control width
         * @see https://doc.babylonjs.com/how_to/gui#position-and-size
         */
        get: function () {
            return this._width.toString(this._host);
        },
        set: function (value) {
            this._fixedRatioMasterIsWidth = true;
            if (this._width.toString(this._host) === value) {
                return;
            }
            if (this._width.fromString(value)) {
                this._markAsDirty();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "widthInPixels", {
        /**
         * Gets or sets the control width in pixel
         * @see https://doc.babylonjs.com/how_to/gui#position-and-size
         */
        get: function () {
            return this._width.getValueInPixel(this._host, this._cachedParentMeasure.width);
        },
        set: function (value) {
            if (isNaN(value)) {
                return;
            }
            this._fixedRatioMasterIsWidth = true;
            this.width = value + "px";
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "height", {
        /**
         * Gets or sets control height
         * @see https://doc.babylonjs.com/how_to/gui#position-and-size
         */
        get: function () {
            return this._height.toString(this._host);
        },
        set: function (value) {
            this._fixedRatioMasterIsWidth = false;
            if (this._height.toString(this._host) === value) {
                return;
            }
            if (this._height.fromString(value)) {
                this._markAsDirty();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "heightInPixels", {
        /**
         * Gets or sets control height in pixel
         * @see https://doc.babylonjs.com/how_to/gui#position-and-size
         */
        get: function () {
            return this._height.getValueInPixel(this._host, this._cachedParentMeasure.height);
        },
        set: function (value) {
            if (isNaN(value)) {
                return;
            }
            this._fixedRatioMasterIsWidth = false;
            this.height = value + "px";
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "fontFamily", {
        /** Gets or set font family */
        get: function () {
            return this._fontFamily;
        },
        set: function (value) {
            if (this._fontFamily === value) {
                return;
            }
            this._fontFamily = value;
            this._resetFontCache();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "fontStyle", {
        /** Gets or sets font style */
        get: function () {
            return this._fontStyle;
        },
        set: function (value) {
            if (this._fontStyle === value) {
                return;
            }
            this._fontStyle = value;
            this._resetFontCache();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "fontWeight", {
        /** Gets or sets font weight */
        get: function () {
            return this._fontWeight;
        },
        set: function (value) {
            if (this._fontWeight === value) {
                return;
            }
            this._fontWeight = value;
            this._resetFontCache();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "style", {
        /**
         * Gets or sets style
         * @see https://doc.babylonjs.com/how_to/gui#styles
         */
        get: function () {
            return this._style;
        },
        set: function (value) {
            var _this = this;
            if (this._style) {
                this._style.onChangedObservable.remove(this._styleObserver);
                this._styleObserver = null;
            }
            this._style = value;
            if (this._style) {
                this._styleObserver = this._style.onChangedObservable.add(function () {
                    _this._markAsDirty();
                    _this._resetFontCache();
                });
            }
            this._markAsDirty();
            this._resetFontCache();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "_isFontSizeInPercentage", {
        /** @hidden */
        get: function () {
            return this._fontSize.isPercentage;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "fontSizeInPixels", {
        /** Gets or sets font size in pixels */
        get: function () {
            var fontSizeToUse = this._style ? this._style._fontSize : this._fontSize;
            if (fontSizeToUse.isPixel) {
                return fontSizeToUse.getValue(this._host);
            }
            return fontSizeToUse.getValueInPixel(this._host, this._tempParentMeasure.height || this._cachedParentMeasure.height);
        },
        set: function (value) {
            if (isNaN(value)) {
                return;
            }
            this.fontSize = value + "px";
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "fontSize", {
        /** Gets or sets font size */
        get: function () {
            return this._fontSize.toString(this._host);
        },
        set: function (value) {
            if (this._fontSize.toString(this._host) === value) {
                return;
            }
            if (this._fontSize.fromString(value)) {
                this._markAsDirty();
                this._resetFontCache();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "color", {
        /** Gets or sets foreground color */
        get: function () {
            return this._color;
        },
        set: function (value) {
            if (this._color === value) {
                return;
            }
            this._color = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "zIndex", {
        /** Gets or sets z index which is used to reorder controls on the z axis */
        get: function () {
            return this._zIndex;
        },
        set: function (value) {
            if (this.zIndex === value) {
                return;
            }
            this._zIndex = value;
            if (this.parent) {
                this.parent._reOrderControl(this);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "notRenderable", {
        /** Gets or sets a boolean indicating if the control can be rendered */
        get: function () {
            return this._doNotRender;
        },
        set: function (value) {
            if (this._doNotRender === value) {
                return;
            }
            this._doNotRender = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "isVisible", {
        /** Gets or sets a boolean indicating if the control is visible */
        get: function () {
            return this._isVisible;
        },
        set: function (value) {
            if (this._isVisible === value) {
                return;
            }
            this._isVisible = value;
            this._markAsDirty(true);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "isDirty", {
        /** Gets a boolean indicating that the control needs to update its rendering */
        get: function () {
            return this._isDirty;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "linkedMesh", {
        /**
         * Gets the current linked mesh (or null if none)
         */
        get: function () {
            return this._linkedMesh;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "descendantsOnlyPadding", {
        /**
         * Gets or sets a value indicating the padding should work like in CSS.
         * Basically, it will add the padding amount on each side of the parent control for its children.
         */
        get: function () {
            return this._descendantsOnlyPadding;
        },
        set: function (value) {
            if (this._descendantsOnlyPadding === value) {
                return;
            }
            this._descendantsOnlyPadding = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "paddingLeft", {
        /**
         * Gets or sets a value indicating the padding to use on the left of the control
         * @see https://doc.babylonjs.com/how_to/gui#position-and-size
         */
        get: function () {
            return this._paddingLeft.toString(this._host);
        },
        set: function (value) {
            if (this._paddingLeft.fromString(value)) {
                this._markAsDirty();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "paddingLeftInPixels", {
        /**
         * Gets or sets a value indicating the padding in pixels to use on the left of the control
         * @see https://doc.babylonjs.com/how_to/gui#position-and-size
         */
        get: function () {
            return this._paddingLeft.getValueInPixel(this._host, this._cachedParentMeasure.width);
        },
        set: function (value) {
            if (isNaN(value)) {
                return;
            }
            this.paddingLeft = value + "px";
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "_paddingLeftInPixels", {
        /** @hidden */
        get: function () {
            if (this._descendantsOnlyPadding) {
                return 0;
            }
            return this.paddingLeftInPixels;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "paddingRight", {
        /**
         * Gets or sets a value indicating the padding to use on the right of the control
         * @see https://doc.babylonjs.com/how_to/gui#position-and-size
         */
        get: function () {
            return this._paddingRight.toString(this._host);
        },
        set: function (value) {
            if (this._paddingRight.fromString(value)) {
                this._markAsDirty();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "paddingRightInPixels", {
        /**
         * Gets or sets a value indicating the padding in pixels to use on the right of the control
         * @see https://doc.babylonjs.com/how_to/gui#position-and-size
         */
        get: function () {
            return this._paddingRight.getValueInPixel(this._host, this._cachedParentMeasure.width);
        },
        set: function (value) {
            if (isNaN(value)) {
                return;
            }
            this.paddingRight = value + "px";
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "_paddingRightInPixels", {
        /** @hidden */
        get: function () {
            if (this._descendantsOnlyPadding) {
                return 0;
            }
            return this.paddingRightInPixels;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "paddingTop", {
        /**
         * Gets or sets a value indicating the padding to use on the top of the control
         * @see https://doc.babylonjs.com/how_to/gui#position-and-size
         */
        get: function () {
            return this._paddingTop.toString(this._host);
        },
        set: function (value) {
            if (this._paddingTop.fromString(value)) {
                this._markAsDirty();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "paddingTopInPixels", {
        /**
         * Gets or sets a value indicating the padding in pixels to use on the top of the control
         * @see https://doc.babylonjs.com/how_to/gui#position-and-size
         */
        get: function () {
            return this._paddingTop.getValueInPixel(this._host, this._cachedParentMeasure.height);
        },
        set: function (value) {
            if (isNaN(value)) {
                return;
            }
            this.paddingTop = value + "px";
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "_paddingTopInPixels", {
        /** @hidden */
        get: function () {
            if (this._descendantsOnlyPadding) {
                return 0;
            }
            return this.paddingTopInPixels;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "paddingBottom", {
        /**
         * Gets or sets a value indicating the padding to use on the bottom of the control
         * @see https://doc.babylonjs.com/how_to/gui#position-and-size
         */
        get: function () {
            return this._paddingBottom.toString(this._host);
        },
        set: function (value) {
            if (this._paddingBottom.fromString(value)) {
                this._markAsDirty();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "paddingBottomInPixels", {
        /**
         * Gets or sets a value indicating the padding in pixels to use on the bottom of the control
         * @see https://doc.babylonjs.com/how_to/gui#position-and-size
         */
        get: function () {
            return this._paddingBottom.getValueInPixel(this._host, this._cachedParentMeasure.height);
        },
        set: function (value) {
            if (isNaN(value)) {
                return;
            }
            this.paddingBottom = value + "px";
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "_paddingBottomInPixels", {
        /** @hidden */
        get: function () {
            if (this._descendantsOnlyPadding) {
                return 0;
            }
            return this.paddingBottomInPixels;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "left", {
        /**
         * Gets or sets a value indicating the left coordinate of the control
         * @see https://doc.babylonjs.com/how_to/gui#position-and-size
         */
        get: function () {
            return this._left.toString(this._host);
        },
        set: function (value) {
            if (this._left.fromString(value)) {
                this._markAsDirty();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "leftInPixels", {
        /**
         * Gets or sets a value indicating the left coordinate in pixels of the control
         * @see https://doc.babylonjs.com/how_to/gui#position-and-size
         */
        get: function () {
            return this._left.getValueInPixel(this._host, this._cachedParentMeasure.width);
        },
        set: function (value) {
            if (isNaN(value)) {
                return;
            }
            this.left = value + "px";
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "top", {
        /**
         * Gets or sets a value indicating the top coordinate of the control
         * @see https://doc.babylonjs.com/how_to/gui#position-and-size
         */
        get: function () {
            return this._top.toString(this._host);
        },
        set: function (value) {
            if (this._top.fromString(value)) {
                this._markAsDirty();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "topInPixels", {
        /**
         * Gets or sets a value indicating the top coordinate in pixels of the control
         * @see https://doc.babylonjs.com/how_to/gui#position-and-size
         */
        get: function () {
            return this._top.getValueInPixel(this._host, this._cachedParentMeasure.height);
        },
        set: function (value) {
            if (isNaN(value)) {
                return;
            }
            this.top = value + "px";
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "linkOffsetX", {
        /**
         * Gets or sets a value indicating the offset on X axis to the linked mesh
         * @see https://doc.babylonjs.com/how_to/gui#tracking-positions
         */
        get: function () {
            return this._linkOffsetX.toString(this._host);
        },
        set: function (value) {
            if (this._linkOffsetX.fromString(value)) {
                this._markAsDirty();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "linkOffsetXInPixels", {
        /**
         * Gets or sets a value indicating the offset in pixels on X axis to the linked mesh
         * @see https://doc.babylonjs.com/how_to/gui#tracking-positions
         */
        get: function () {
            return this._linkOffsetX.getValueInPixel(this._host, this._cachedParentMeasure.width);
        },
        set: function (value) {
            if (isNaN(value)) {
                return;
            }
            this.linkOffsetX = value + "px";
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "linkOffsetY", {
        /**
         * Gets or sets a value indicating the offset on Y axis to the linked mesh
         * @see https://doc.babylonjs.com/how_to/gui#tracking-positions
         */
        get: function () {
            return this._linkOffsetY.toString(this._host);
        },
        set: function (value) {
            if (this._linkOffsetY.fromString(value)) {
                this._markAsDirty();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "linkOffsetYInPixels", {
        /**
         * Gets or sets a value indicating the offset in pixels on Y axis to the linked mesh
         * @see https://doc.babylonjs.com/how_to/gui#tracking-positions
         */
        get: function () {
            return this._linkOffsetY.getValueInPixel(this._host, this._cachedParentMeasure.height);
        },
        set: function (value) {
            if (isNaN(value)) {
                return;
            }
            this.linkOffsetY = value + "px";
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "centerX", {
        /** Gets the center coordinate on X axis */
        get: function () {
            return this._currentMeasure.left + this._currentMeasure.width / 2;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "centerY", {
        /** Gets the center coordinate on Y axis */
        get: function () {
            return this._currentMeasure.top + this._currentMeasure.height / 2;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "isEnabled", {
        /** Gets or sets if control is Enabled */
        get: function () {
            return this._isEnabled;
        },
        set: function (value) {
            var _this = this;
            if (this._isEnabled === value) {
                return;
            }
            this._isEnabled = value;
            this._markAsDirty();
            // if this control or any of it's descendants are under a pointer, we need to fire a pointerOut event
            var recursivelyFirePointerOut = function (control) {
                if (!control.host) {
                    return;
                }
                for (var pointer in control.host._lastControlOver) {
                    if (control === _this.host._lastControlOver[pointer]) {
                        control._onPointerOut(control, null, true);
                        delete control.host._lastControlOver[pointer];
                    }
                }
                if (control.children !== undefined) {
                    control.children.forEach(recursivelyFirePointerOut);
                }
            };
            recursivelyFirePointerOut(this);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "disabledColor", {
        /** Gets or sets background color of control if it's disabled. Only applies to Button class. */
        get: function () {
            return this._disabledColor;
        },
        set: function (value) {
            if (this._disabledColor === value) {
                return;
            }
            this._disabledColor = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control.prototype, "disabledColorItem", {
        /** Gets or sets front color of control if it's disabled. Only applies to Checkbox class. */
        get: function () {
            return this._disabledColorItem;
        },
        set: function (value) {
            if (this._disabledColorItem === value) {
                return;
            }
            this._disabledColorItem = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    /** @hidden */
    Control.prototype._getTypeName = function () {
        return "Control";
    };
    /**
     * Gets the first ascendant in the hierarchy of the given type
     * @param className defines the required type
     * @returns the ascendant or null if not found
     */
    Control.prototype.getAscendantOfClass = function (className) {
        if (!this.parent) {
            return null;
        }
        if (this.parent.getClassName() === className) {
            return this.parent;
        }
        return this.parent.getAscendantOfClass(className);
    };
    /**
     * Mark control element as dirty
     * @param force force non visible elements to be marked too
     */
    Control.prototype.markAsDirty = function (force) {
        if (force === void 0) { force = false; }
        this._markAsDirty(force);
    };
    /**
     * Mark the element and its children as dirty
     */
    Control.prototype.markAllAsDirty = function () {
        this._markAllAsDirty();
    };
    /** @hidden */
    Control.prototype._resetFontCache = function () {
        this._fontSet = true;
        this._markAsDirty();
    };
    /**
     * Determines if a container is an ascendant of the current control
     * @param container defines the container to look for
     * @returns true if the container is one of the ascendant of the control
     */
    Control.prototype.isAscendant = function (container) {
        if (!this.parent) {
            return false;
        }
        if (this.parent === container) {
            return true;
        }
        return this.parent.isAscendant(container);
    };
    /**
     * Gets coordinates in local control space
     * @param globalCoordinates defines the coordinates to transform
     * @returns the new coordinates in local space
     */
    Control.prototype.getLocalCoordinates = function (globalCoordinates) {
        var result = core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Vector2.Zero();
        this.getLocalCoordinatesToRef(globalCoordinates, result);
        return result;
    };
    /**
     * Gets coordinates in local control space
     * @param globalCoordinates defines the coordinates to transform
     * @param result defines the target vector2 where to store the result
     * @returns the current control
     */
    Control.prototype.getLocalCoordinatesToRef = function (globalCoordinates, result) {
        result.x = globalCoordinates.x - this._currentMeasure.left;
        result.y = globalCoordinates.y - this._currentMeasure.top;
        return this;
    };
    /**
     * Gets coordinates in parent local control space
     * @param globalCoordinates defines the coordinates to transform
     * @returns the new coordinates in parent local space
     */
    Control.prototype.getParentLocalCoordinates = function (globalCoordinates) {
        var result = core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Vector2.Zero();
        result.x = globalCoordinates.x - this._cachedParentMeasure.left;
        result.y = globalCoordinates.y - this._cachedParentMeasure.top;
        return result;
    };
    /**
     * Move the current control to a vector3 position projected onto the screen.
     * @param position defines the target position
     * @param scene defines the hosting scene
     */
    Control.prototype.moveToVector3 = function (position, scene) {
        if (!this._host || this.parent !== this._host._rootContainer) {
            core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Tools.Error("Cannot move a control to a vector3 if the control is not at root level");
            return;
        }
        this.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;
        this.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;
        var globalViewport = this._host._getGlobalViewport();
        var projectedPosition = core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Vector3.Project(position, core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Matrix.Identity(), scene.getTransformMatrix(), globalViewport);
        this._moveToProjectedPosition(projectedPosition);
        if (projectedPosition.z < 0 || projectedPosition.z > 1) {
            this.notRenderable = true;
            return;
        }
        this.notRenderable = false;
    };
    /**
     * Will store all controls that have this control as ascendant in a given array
     * @param results defines the array where to store the descendants
     * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
     * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
     */
    Control.prototype.getDescendantsToRef = function (results, directDescendantsOnly, predicate) {
        if (directDescendantsOnly === void 0) { directDescendantsOnly = false; }
        // Do nothing by default
    };
    /**
     * Will return all controls that have this control as ascendant
     * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
     * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
     * @return all child controls
     */
    Control.prototype.getDescendants = function (directDescendantsOnly, predicate) {
        var results = new Array();
        this.getDescendantsToRef(results, directDescendantsOnly, predicate);
        return results;
    };
    /**
     * Link current control with a target mesh
     * @param mesh defines the mesh to link with
     * @see https://doc.babylonjs.com/how_to/gui#tracking-positions
     */
    Control.prototype.linkWithMesh = function (mesh) {
        if (!this._host || (this.parent && this.parent !== this._host._rootContainer)) {
            if (mesh) {
                core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Tools.Error("Cannot link a control to a mesh if the control is not at root level");
            }
            return;
        }
        var index = this._host._linkedControls.indexOf(this);
        if (index !== -1) {
            this._linkedMesh = mesh;
            if (!mesh) {
                this._host._linkedControls.splice(index, 1);
            }
            return;
        }
        else if (!mesh) {
            return;
        }
        this.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;
        this.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;
        this._linkedMesh = mesh;
        this._host._linkedControls.push(this);
    };
    /**
     * Shorthand function to set the top, right, bottom, and left padding values on the control.
     * @param { string | number} paddingTop - The value of the top padding.
     * @param { string | number} paddingRight - The value of the right padding. If omitted, top is used.
     * @param { string | number} paddingBottom - The value of the bottom padding. If omitted, top is used.
     * @param { string | number} paddingLeft - The value of the left padding. If omitted, right is used.
     * @see https://doc.babylonjs.com/how_to/gui#position-and-size
     */
    Control.prototype.setPadding = function (paddingTop, paddingRight, paddingBottom, paddingLeft) {
        var top = paddingTop;
        var right = paddingRight !== null && paddingRight !== void 0 ? paddingRight : top;
        var bottom = paddingBottom !== null && paddingBottom !== void 0 ? paddingBottom : top;
        var left = paddingLeft !== null && paddingLeft !== void 0 ? paddingLeft : right;
        this.paddingTop = top;
        this.paddingRight = right;
        this.paddingBottom = bottom;
        this.paddingLeft = left;
    };
    /**
     * Shorthand funtion to set the top, right, bottom, and left padding values in pixels on the control.
     * @param { number} paddingTop - The value in pixels of the top padding.
     * @param { number} paddingRight - The value in pixels of the right padding. If omitted, top is used.
     * @param { number} paddingBottom - The value in pixels of the bottom padding. If omitted, top is used.
     * @param { number} paddingLeft - The value in pixels of the left padding. If omitted, right is used.
     * @see https://doc.babylonjs.com/how_to/gui#position-and-size
     */
    Control.prototype.setPaddingInPixels = function (paddingTop, paddingRight, paddingBottom, paddingLeft) {
        var top = paddingTop;
        var right = paddingRight !== null && paddingRight !== void 0 ? paddingRight : top;
        var bottom = paddingBottom !== null && paddingBottom !== void 0 ? paddingBottom : top;
        var left = paddingLeft !== null && paddingLeft !== void 0 ? paddingLeft : right;
        this.paddingTopInPixels = top;
        this.paddingRightInPixels = right;
        this.paddingBottomInPixels = bottom;
        this.paddingLeftInPixels = left;
    };
    /**
     * @param projectedPosition
     * @hidden
     */
    Control.prototype._moveToProjectedPosition = function (projectedPosition) {
        var _a;
        var oldLeft = this._left.getValue(this._host);
        var oldTop = this._top.getValue(this._host);
        var parentMeasure = (_a = this.parent) === null || _a === void 0 ? void 0 : _a._currentMeasure;
        if (parentMeasure) {
            this._processMeasures(parentMeasure, this._host.getContext());
        }
        var newLeft = projectedPosition.x + this._linkOffsetX.getValue(this._host) - this._currentMeasure.width / 2;
        var newTop = projectedPosition.y + this._linkOffsetY.getValue(this._host) - this._currentMeasure.height / 2;
        if (this._left.ignoreAdaptiveScaling && this._top.ignoreAdaptiveScaling) {
            if (Math.abs(newLeft - oldLeft) < 0.5) {
                newLeft = oldLeft;
            }
            if (Math.abs(newTop - oldTop) < 0.5) {
                newTop = oldTop;
            }
        }
        this.left = newLeft + "px";
        this.top = newTop + "px";
        this._left.ignoreAdaptiveScaling = true;
        this._top.ignoreAdaptiveScaling = true;
        this._markAsDirty();
    };
    /**
     * @param offset
     * @hidden
     */
    Control.prototype._offsetLeft = function (offset) {
        this._isDirty = true;
        this._currentMeasure.left += offset;
    };
    /**
     * @param offset
     * @hidden
     */
    Control.prototype._offsetTop = function (offset) {
        this._isDirty = true;
        this._currentMeasure.top += offset;
    };
    /** @hidden */
    Control.prototype._markMatrixAsDirty = function () {
        this._isMatrixDirty = true;
        this._flagDescendantsAsMatrixDirty();
    };
    /** @hidden */
    Control.prototype._flagDescendantsAsMatrixDirty = function () {
        // No child
    };
    /**
     * @param rect
     * @param context
     * @hidden
     */
    Control.prototype._intersectsRect = function (rect, context) {
        // make sure we are transformed correctly before checking intersections. no-op if nothing is dirty.
        this._transform(context);
        if (this._evaluatedMeasure.left >= rect.left + rect.width) {
            return false;
        }
        if (this._evaluatedMeasure.top >= rect.top + rect.height) {
            return false;
        }
        if (this._evaluatedMeasure.left + this._evaluatedMeasure.width <= rect.left) {
            return false;
        }
        if (this._evaluatedMeasure.top + this._evaluatedMeasure.height <= rect.top) {
            return false;
        }
        return true;
    };
    /** @hidden */
    Control.prototype._computeAdditionnalOffsetX = function () {
        return 0;
    };
    /** @hidden */
    Control.prototype._computeAdditionnalOffsetY = function () {
        return 0;
    };
    /** @hidden */
    // eslint-disable-next-line @typescript-eslint/naming-convention
    Control.prototype.invalidateRect = function () {
        this._transform();
        if (this.host && this.host.useInvalidateRectOptimization) {
            // Rotate by transform to get the measure transformed to global space
            this._currentMeasure.transformToRef(this._transformMatrix, this._tmpMeasureA);
            // get the boudning box of the current measure and last frames measure in global space and invalidate it
            // the previous measure is used to properly clear a control that is scaled down
            _measure__WEBPACK_IMPORTED_MODULE_3__.Measure.CombineToRef(this._tmpMeasureA, this._prevCurrentMeasureTransformedIntoGlobalSpace, this._tmpMeasureA);
            // Expand rect based on shadows
            var shadowOffsetX = this.shadowOffsetX;
            var shadowOffsetY = this.shadowOffsetY;
            var shadowBlur = Math.max(this._previousShadowBlur, this.shadowBlur);
            var leftShadowOffset = Math.min(Math.min(shadowOffsetX, 0) - shadowBlur * 2, 0);
            var rightShadowOffset = Math.max(Math.max(shadowOffsetX, 0) + shadowBlur * 2, 0);
            var topShadowOffset = Math.min(Math.min(shadowOffsetY, 0) - shadowBlur * 2, 0);
            var bottomShadowOffset = Math.max(Math.max(shadowOffsetY, 0) + shadowBlur * 2, 0);
            var offsetX = this._computeAdditionnalOffsetX();
            var offsetY = this._computeAdditionnalOffsetY();
            this.host.invalidateRect(Math.floor(this._tmpMeasureA.left + leftShadowOffset - offsetX), Math.floor(this._tmpMeasureA.top + topShadowOffset - offsetY), Math.ceil(this._tmpMeasureA.left + this._tmpMeasureA.width + rightShadowOffset + offsetX), Math.ceil(this._tmpMeasureA.top + this._tmpMeasureA.height + bottomShadowOffset + offsetY));
        }
    };
    /**
     * @param force
     * @hidden
     */
    Control.prototype._markAsDirty = function (force) {
        if (force === void 0) { force = false; }
        if (!this._isVisible && !force) {
            return;
        }
        this._isDirty = true;
        this._markMatrixAsDirty();
        // Redraw only this rectangle
        if (this._host) {
            this._host.markAsDirty();
        }
    };
    /** @hidden */
    Control.prototype._markAllAsDirty = function () {
        this._markAsDirty();
        if (this._font) {
            this._prepareFont();
        }
    };
    /**
     * @param host
     * @hidden
     */
    Control.prototype._link = function (host) {
        this._host = host;
        if (this._host) {
            this.uniqueId = this._host.getScene().getUniqueId();
        }
    };
    /**
     * @param context
     * @hidden
     */
    Control.prototype._transform = function (context) {
        if (!this._isMatrixDirty && this._scaleX === 1 && this._scaleY === 1 && this._rotation === 0) {
            return;
        }
        // postTranslate
        var offsetX = this._currentMeasure.width * this._transformCenterX + this._currentMeasure.left;
        var offsetY = this._currentMeasure.height * this._transformCenterY + this._currentMeasure.top;
        if (context) {
            context.translate(offsetX, offsetY);
            // rotate
            context.rotate(this._rotation);
            // scale
            context.scale(this._scaleX, this._scaleY);
            // preTranslate
            context.translate(-offsetX, -offsetY);
        }
        // Need to update matrices?
        if (this._isMatrixDirty || this._cachedOffsetX !== offsetX || this._cachedOffsetY !== offsetY) {
            this._cachedOffsetX = offsetX;
            this._cachedOffsetY = offsetY;
            this._isMatrixDirty = false;
            this._flagDescendantsAsMatrixDirty();
            _math2D__WEBPACK_IMPORTED_MODULE_4__.Matrix2D.ComposeToRef(-offsetX, -offsetY, this._rotation, this._scaleX, this._scaleY, this.parent ? this.parent._transformMatrix : null, this._transformMatrix);
            this._transformMatrix.invertToRef(this._invertTransformMatrix);
            this._currentMeasure.transformToRef(this._transformMatrix, this._evaluatedMeasure);
        }
    };
    /**
     * @param context
     * @hidden
     */
    Control.prototype._renderHighlight = function (context) {
        if (!this.isHighlighted) {
            return;
        }
        context.save();
        context.strokeStyle = this._highlightColor;
        context.lineWidth = this._highlightLineWidth;
        this._renderHighlightSpecific(context);
        context.restore();
    };
    /**
     * @param context
     * @hidden
     */
    Control.prototype._renderHighlightSpecific = function (context) {
        context.strokeRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);
    };
    /**
     * @param context
     * @hidden
     */
    Control.prototype._applyStates = function (context) {
        if (this._isFontSizeInPercentage) {
            this._fontSet = true;
        }
        if (this._host && this._host.useSmallestIdeal && !this._font) {
            this._fontSet = true;
        }
        if (this._fontSet) {
            this._prepareFont();
            this._fontSet = false;
        }
        if (this._font) {
            context.font = this._font;
        }
        if (this._color) {
            context.fillStyle = this._color;
        }
        if (Control.AllowAlphaInheritance) {
            context.globalAlpha *= this._alpha;
        }
        else if (this._alphaSet) {
            context.globalAlpha = this.parent && !this.parent.renderToIntermediateTexture ? this.parent.alpha * this._alpha : this._alpha;
        }
    };
    /**
     * @param parentMeasure
     * @param context
     * @hidden
     */
    Control.prototype._layout = function (parentMeasure, context) {
        if (!this.isDirty && (!this.isVisible || this.notRenderable)) {
            return false;
        }
        if (this._isDirty || !this._cachedParentMeasure.isEqualsTo(parentMeasure)) {
            this.host._numLayoutCalls++;
            this._currentMeasure.addAndTransformToRef(this._transformMatrix, -this._paddingLeftInPixels | 0, -this._paddingTopInPixels | 0, this._paddingRightInPixels | 0, this._paddingBottomInPixels | 0, this._prevCurrentMeasureTransformedIntoGlobalSpace);
            context.save();
            this._applyStates(context);
            var rebuildCount = 0;
            do {
                this._rebuildLayout = false;
                this._processMeasures(parentMeasure, context);
                rebuildCount++;
            } while (this._rebuildLayout && rebuildCount < 3);
            if (rebuildCount >= 3) {
                core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Logger.Error("Layout cycle detected in GUI (Control name=".concat(this.name, ", uniqueId=").concat(this.uniqueId, ")"));
            }
            context.restore();
            this.invalidateRect();
            this._evaluateClippingState(parentMeasure);
        }
        this._wasDirty = this._isDirty;
        this._isDirty = false;
        return true;
    };
    /**
     * @param parentMeasure
     * @param context
     * @hidden
     */
    Control.prototype._processMeasures = function (parentMeasure, context) {
        this._tempPaddingMeasure.copyFrom(parentMeasure);
        // Apply padding if in correct mode
        if (this.parent && this.parent.descendantsOnlyPadding) {
            this._tempPaddingMeasure.left += this.parent.paddingLeftInPixels;
            this._tempPaddingMeasure.top += this.parent.paddingTopInPixels;
            this._tempPaddingMeasure.width -= this.parent.paddingLeftInPixels + this.parent.paddingRightInPixels;
            this._tempPaddingMeasure.height -= this.parent.paddingTopInPixels + this.parent.paddingBottomInPixels;
        }
        this._currentMeasure.copyFrom(this._tempPaddingMeasure);
        // Let children take some pre-measurement actions
        this._preMeasure(this._tempPaddingMeasure, context);
        this._measure();
        this._computeAlignment(this._tempPaddingMeasure, context);
        // Convert to int values
        this._currentMeasure.left = this._currentMeasure.left | 0;
        this._currentMeasure.top = this._currentMeasure.top | 0;
        this._currentMeasure.width = this._currentMeasure.width | 0;
        this._currentMeasure.height = this._currentMeasure.height | 0;
        // Let children add more features
        this._additionalProcessing(this._tempPaddingMeasure, context);
        this._cachedParentMeasure.copyFrom(this._tempPaddingMeasure);
        this._currentMeasure.transformToRef(this._transformMatrix, this._evaluatedMeasure);
        if (this.onDirtyObservable.hasObservers()) {
            this.onDirtyObservable.notifyObservers(this);
        }
    };
    Control.prototype._evaluateClippingState = function (parentMeasure) {
        this._currentMeasure.transformToRef(this._transformMatrix, this._evaluatedMeasure);
        if (this.parent && this.parent.clipChildren) {
            parentMeasure.transformToRef(this.parent._transformMatrix, this._evaluatedParentMeasure);
            // Early clip
            if (this._evaluatedMeasure.left > this._evaluatedParentMeasure.left + this._evaluatedParentMeasure.width) {
                this._isClipped = true;
                return;
            }
            if (this._evaluatedMeasure.left + this._evaluatedMeasure.width < this._evaluatedParentMeasure.left) {
                this._isClipped = true;
                return;
            }
            if (this._evaluatedMeasure.top > this._evaluatedParentMeasure.top + this._evaluatedParentMeasure.height) {
                this._isClipped = true;
                return;
            }
            if (this._evaluatedMeasure.top + this._evaluatedMeasure.height < this._evaluatedParentMeasure.top) {
                this._isClipped = true;
                return;
            }
        }
        this._isClipped = false;
    };
    /** @hidden */
    Control.prototype._measure = function () {
        // Width / Height
        if (this._width.isPixel) {
            this._currentMeasure.width = this._width.getValue(this._host);
        }
        else {
            this._currentMeasure.width *= this._width.getValue(this._host);
        }
        if (this._height.isPixel) {
            this._currentMeasure.height = this._height.getValue(this._host);
        }
        else {
            this._currentMeasure.height *= this._height.getValue(this._host);
        }
        if (this.fixedRatio !== 0) {
            if (this._fixedRatioMasterIsWidth) {
                this._currentMeasure.height = this._currentMeasure.width * this.fixedRatio;
            }
            else {
                this._currentMeasure.width = this._currentMeasure.height * this.fixedRatio;
            }
        }
    };
    /**
     * @param parentMeasure
     * @param context
     * @hidden
     */
    Control.prototype._computeAlignment = function (parentMeasure, context) {
        var width = this._currentMeasure.width;
        var height = this._currentMeasure.height;
        var parentWidth = parentMeasure.width;
        var parentHeight = parentMeasure.height;
        // Left / top
        var x = 0;
        var y = 0;
        switch (this.horizontalAlignment) {
            case Control.HORIZONTAL_ALIGNMENT_LEFT:
                x = 0;
                break;
            case Control.HORIZONTAL_ALIGNMENT_RIGHT:
                x = parentWidth - width;
                break;
            case Control.HORIZONTAL_ALIGNMENT_CENTER:
                x = (parentWidth - width) / 2;
                break;
        }
        switch (this.verticalAlignment) {
            case Control.VERTICAL_ALIGNMENT_TOP:
                y = 0;
                break;
            case Control.VERTICAL_ALIGNMENT_BOTTOM:
                y = parentHeight - height;
                break;
            case Control.VERTICAL_ALIGNMENT_CENTER:
                y = (parentHeight - height) / 2;
                break;
        }
        if (!this.descendantsOnlyPadding) {
            if (this._paddingLeft.isPixel) {
                this._currentMeasure.left += this._paddingLeft.getValue(this._host);
                this._currentMeasure.width -= this._paddingLeft.getValue(this._host);
            }
            else {
                this._currentMeasure.left += parentWidth * this._paddingLeft.getValue(this._host);
                this._currentMeasure.width -= parentWidth * this._paddingLeft.getValue(this._host);
            }
            if (this._paddingRight.isPixel) {
                this._currentMeasure.width -= this._paddingRight.getValue(this._host);
            }
            else {
                this._currentMeasure.width -= parentWidth * this._paddingRight.getValue(this._host);
            }
            if (this._paddingTop.isPixel) {
                this._currentMeasure.top += this._paddingTop.getValue(this._host);
                this._currentMeasure.height -= this._paddingTop.getValue(this._host);
            }
            else {
                this._currentMeasure.top += parentHeight * this._paddingTop.getValue(this._host);
                this._currentMeasure.height -= parentHeight * this._paddingTop.getValue(this._host);
            }
            if (this._paddingBottom.isPixel) {
                this._currentMeasure.height -= this._paddingBottom.getValue(this._host);
            }
            else {
                this._currentMeasure.height -= parentHeight * this._paddingBottom.getValue(this._host);
            }
        }
        if (this._left.isPixel) {
            this._currentMeasure.left += this._left.getValue(this._host);
        }
        else {
            this._currentMeasure.left += parentWidth * this._left.getValue(this._host);
        }
        if (this._top.isPixel) {
            this._currentMeasure.top += this._top.getValue(this._host);
        }
        else {
            this._currentMeasure.top += parentHeight * this._top.getValue(this._host);
        }
        this._currentMeasure.left += x;
        this._currentMeasure.top += y;
    };
    /**
     * @param parentMeasure
     * @param context
     * @hidden
     */
    Control.prototype._preMeasure = function (parentMeasure, context) {
        // Do nothing
    };
    /**
     * @param parentMeasure
     * @param context
     * @hidden
     */
    Control.prototype._additionalProcessing = function (parentMeasure, context) {
        // Do nothing
    };
    /**
     * @param context
     * @hidden
     */
    Control.prototype._clipForChildren = function (context) {
        // DO nothing
    };
    Control.prototype._clip = function (context, invalidatedRectangle) {
        context.beginPath();
        Control._ClipMeasure.copyFrom(this._currentMeasure);
        if (invalidatedRectangle) {
            // Rotate the invalidated rect into the control's space
            invalidatedRectangle.transformToRef(this._invertTransformMatrix, this._tmpMeasureA);
            // Get the intersection of the rect in context space and the current context
            var intersection = new _measure__WEBPACK_IMPORTED_MODULE_3__.Measure(0, 0, 0, 0);
            intersection.left = Math.max(this._tmpMeasureA.left, this._currentMeasure.left);
            intersection.top = Math.max(this._tmpMeasureA.top, this._currentMeasure.top);
            intersection.width = Math.min(this._tmpMeasureA.left + this._tmpMeasureA.width, this._currentMeasure.left + this._currentMeasure.width) - intersection.left;
            intersection.height = Math.min(this._tmpMeasureA.top + this._tmpMeasureA.height, this._currentMeasure.top + this._currentMeasure.height) - intersection.top;
            Control._ClipMeasure.copyFrom(intersection);
        }
        if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
            var shadowOffsetX = this.shadowOffsetX;
            var shadowOffsetY = this.shadowOffsetY;
            var shadowBlur = this.shadowBlur;
            var leftShadowOffset = Math.min(Math.min(shadowOffsetX, 0) - shadowBlur * 2, 0);
            var rightShadowOffset = Math.max(Math.max(shadowOffsetX, 0) + shadowBlur * 2, 0);
            var topShadowOffset = Math.min(Math.min(shadowOffsetY, 0) - shadowBlur * 2, 0);
            var bottomShadowOffset = Math.max(Math.max(shadowOffsetY, 0) + shadowBlur * 2, 0);
            context.rect(Control._ClipMeasure.left + leftShadowOffset, Control._ClipMeasure.top + topShadowOffset, Control._ClipMeasure.width + rightShadowOffset - leftShadowOffset, Control._ClipMeasure.height + bottomShadowOffset - topShadowOffset);
        }
        else {
            context.rect(Control._ClipMeasure.left, Control._ClipMeasure.top, Control._ClipMeasure.width, Control._ClipMeasure.height);
        }
        context.clip();
    };
    /**
     * @param context
     * @param invalidatedRectangle
     * @hidden
     */
    Control.prototype._render = function (context, invalidatedRectangle) {
        if (!this.isVisible || this.notRenderable || this._isClipped) {
            this._isDirty = false;
            return false;
        }
        this.host._numRenderCalls++;
        context.save();
        this._applyStates(context);
        // Transform
        this._transform(context);
        // Clip
        if (this.clipContent) {
            this._clip(context, invalidatedRectangle);
        }
        if (this.onBeforeDrawObservable.hasObservers()) {
            this.onBeforeDrawObservable.notifyObservers(this);
        }
        if (this.useBitmapCache && !this._wasDirty && this._cacheData) {
            context.putImageData(this._cacheData, this._currentMeasure.left, this._currentMeasure.top);
        }
        else {
            this._draw(context, invalidatedRectangle);
        }
        if (this.useBitmapCache && this._wasDirty) {
            this._cacheData = context.getImageData(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);
        }
        this._renderHighlight(context);
        if (this.onAfterDrawObservable.hasObservers()) {
            this.onAfterDrawObservable.notifyObservers(this);
        }
        context.restore();
        return true;
    };
    /**
     * @param context
     * @param invalidatedRectangle
     * @hidden
     */
    Control.prototype._draw = function (context, invalidatedRectangle) {
        // Do nothing
    };
    /**
     * Tests if a given coordinates belong to the current control
     * @param x defines x coordinate to test
     * @param y defines y coordinate to test
     * @returns true if the coordinates are inside the control
     */
    Control.prototype.contains = function (x, y) {
        // Invert transform
        this._invertTransformMatrix.transformCoordinates(x, y, this._transformedPosition);
        x = this._transformedPosition.x;
        y = this._transformedPosition.y;
        // Check
        if (x < this._currentMeasure.left) {
            return false;
        }
        if (x > this._currentMeasure.left + this._currentMeasure.width) {
            return false;
        }
        if (y < this._currentMeasure.top) {
            return false;
        }
        if (y > this._currentMeasure.top + this._currentMeasure.height) {
            return false;
        }
        if (this.isPointerBlocker) {
            this._host._shouldBlockPointer = true;
        }
        return true;
    };
    /**
     * @param x
     * @param y
     * @param pi
     * @param type
     * @param pointerId
     * @param buttonIndex
     * @param deltaX
     * @param deltaY
     * @hidden
     */
    Control.prototype._processPicking = function (x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY) {
        if (!this._isEnabled) {
            return false;
        }
        if (!this.isHitTestVisible || !this.isVisible || this._doNotRender) {
            return false;
        }
        if (!this.contains(x, y)) {
            return false;
        }
        this._processObservables(type, x, y, pi, pointerId, buttonIndex, deltaX, deltaY);
        return true;
    };
    /**
     * @param target
     * @param coordinates
     * @param pointerId
     * @param pi
     * @hidden
     */
    Control.prototype._onPointerMove = function (target, coordinates, pointerId, pi) {
        var canNotify = this.onPointerMoveObservable.notifyObservers(coordinates, -1, target, this, pi);
        if (canNotify && this.parent != null) {
            this.parent._onPointerMove(target, coordinates, pointerId, pi);
        }
    };
    /**
     * @param target
     * @param pi
     * @hidden
     */
    Control.prototype._onPointerEnter = function (target, pi) {
        if (!this._isEnabled) {
            return false;
        }
        if (this._enterCount > 0) {
            return false;
        }
        if (this._enterCount === -1) {
            // -1 is for touch input, we are now sure we are with a mouse or pencil
            this._enterCount = 0;
        }
        this._enterCount++;
        var canNotify = this.onPointerEnterObservable.notifyObservers(this, -1, target, this, pi);
        if (canNotify && this.parent != null) {
            this.parent._onPointerEnter(target, pi);
        }
        return true;
    };
    /**
     * @param target
     * @param pi
     * @param force
     * @hidden
     */
    Control.prototype._onPointerOut = function (target, pi, force) {
        if (force === void 0) { force = false; }
        if (!force && (!this._isEnabled || target === this)) {
            return;
        }
        this._enterCount = 0;
        var canNotify = true;
        if (!target.isAscendant(this)) {
            canNotify = this.onPointerOutObservable.notifyObservers(this, -1, target, this, pi);
        }
        if (canNotify && this.parent != null) {
            this.parent._onPointerOut(target, pi, force);
        }
    };
    /**
     * @param target
     * @param coordinates
     * @param pointerId
     * @param buttonIndex
     * @param pi
     * @hidden
     */
    Control.prototype._onPointerDown = function (target, coordinates, pointerId, buttonIndex, pi) {
        // Prevent pointerout to lose control context.
        // Event redundancy is checked inside the function.
        this._onPointerEnter(this, pi);
        if (this._downCount !== 0) {
            return false;
        }
        this._downCount++;
        this._downPointerIds[pointerId] = true;
        var canNotify = this.onPointerDownObservable.notifyObservers(new _math2D__WEBPACK_IMPORTED_MODULE_4__.Vector2WithInfo(coordinates, buttonIndex), -1, target, this, pi);
        if (canNotify && this.parent != null) {
            this.parent._onPointerDown(target, coordinates, pointerId, buttonIndex, pi);
        }
        return true;
    };
    /**
     * @param target
     * @param coordinates
     * @param pointerId
     * @param buttonIndex
     * @param notifyClick
     * @param pi
     * @hidden
     */
    Control.prototype._onPointerUp = function (target, coordinates, pointerId, buttonIndex, notifyClick, pi) {
        if (!this._isEnabled) {
            return;
        }
        this._downCount = 0;
        delete this._downPointerIds[pointerId];
        var canNotifyClick = notifyClick;
        if (notifyClick && (this._enterCount > 0 || this._enterCount === -1)) {
            canNotifyClick = this.onPointerClickObservable.notifyObservers(new _math2D__WEBPACK_IMPORTED_MODULE_4__.Vector2WithInfo(coordinates, buttonIndex), -1, target, this, pi);
        }
        var canNotify = this.onPointerUpObservable.notifyObservers(new _math2D__WEBPACK_IMPORTED_MODULE_4__.Vector2WithInfo(coordinates, buttonIndex), -1, target, this, pi);
        if (canNotify && this.parent != null) {
            this.parent._onPointerUp(target, coordinates, pointerId, buttonIndex, canNotifyClick, pi);
        }
    };
    /**
     * @param pointerId
     * @hidden
     */
    Control.prototype._forcePointerUp = function (pointerId) {
        if (pointerId === void 0) { pointerId = null; }
        if (pointerId !== null) {
            this._onPointerUp(this, core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Vector2.Zero(), pointerId, 0, true);
        }
        else {
            for (var key in this._downPointerIds) {
                this._onPointerUp(this, core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Vector2.Zero(), +key, 0, true);
            }
        }
    };
    /**
     * @param deltaX
     * @param deltaY
     * @hidden
     */
    Control.prototype._onWheelScroll = function (deltaX, deltaY) {
        if (!this._isEnabled) {
            return;
        }
        var canNotify = this.onWheelObservable.notifyObservers(new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Vector2(deltaX, deltaY));
        if (canNotify && this.parent != null) {
            this.parent._onWheelScroll(deltaX, deltaY);
        }
    };
    /** @hidden */
    Control.prototype._onCanvasBlur = function () { };
    /**
     * @param type
     * @param x
     * @param y
     * @param pi
     * @param pointerId
     * @param buttonIndex
     * @param deltaX
     * @param deltaY
     * @hidden
     */
    Control.prototype._processObservables = function (type, x, y, pi, pointerId, buttonIndex, deltaX, deltaY) {
        if (!this._isEnabled) {
            return false;
        }
        this._dummyVector2.copyFromFloats(x, y);
        if (type === core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PointerEventTypes.POINTERMOVE) {
            this._onPointerMove(this, this._dummyVector2, pointerId, pi);
            var previousControlOver = this._host._lastControlOver[pointerId];
            if (previousControlOver && previousControlOver !== this) {
                previousControlOver._onPointerOut(this, pi);
            }
            if (previousControlOver !== this) {
                this._onPointerEnter(this, pi);
            }
            this._host._lastControlOver[pointerId] = this;
            return true;
        }
        if (type === core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PointerEventTypes.POINTERDOWN) {
            this._onPointerDown(this, this._dummyVector2, pointerId, buttonIndex, pi);
            this._host._registerLastControlDown(this, pointerId);
            this._host._lastPickedControl = this;
            return true;
        }
        if (type === core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PointerEventTypes.POINTERUP) {
            if (this._host._lastControlDown[pointerId]) {
                this._host._lastControlDown[pointerId]._onPointerUp(this, this._dummyVector2, pointerId, buttonIndex, true, pi);
            }
            delete this._host._lastControlDown[pointerId];
            return true;
        }
        if (type === core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PointerEventTypes.POINTERWHEEL) {
            if (this._host._lastControlOver[pointerId]) {
                this._host._lastControlOver[pointerId]._onWheelScroll(deltaX, deltaY);
                return true;
            }
        }
        return false;
    };
    Control.prototype._prepareFont = function () {
        if (!this._font && !this._fontSet) {
            return;
        }
        if (this._style) {
            this._font = this._style.fontStyle + " " + this._style.fontWeight + " " + this.fontSizeInPixels + "px " + this._style.fontFamily;
        }
        else {
            this._font = this._fontStyle + " " + this._fontWeight + " " + this.fontSizeInPixels + "px " + this._fontFamily;
        }
        this._fontOffset = Control._GetFontOffset(this._font);
        //children need to be refreshed
        this.getDescendants().forEach(function (child) { return child._markAllAsDirty(); });
    };
    /**
     * Serializes the current control
     * @param serializationObject defined the JSON serialized object
     */
    Control.prototype.serialize = function (serializationObject) {
        core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.SerializationHelper.Serialize(this, serializationObject);
        serializationObject.name = this.name;
        serializationObject.className = this.getClassName();
        if (this._font) {
            serializationObject.fontFamily = this._fontFamily;
            serializationObject.fontSize = this.fontSize;
            serializationObject.fontWeight = this.fontWeight;
            serializationObject.fontStyle = this.fontStyle;
        }
    };
    /**
     * @param serializedObject
     * @param host
     * @hidden
     */
    Control.prototype._parseFromContent = function (serializedObject, host) {
        if (serializedObject.fontFamily) {
            this.fontFamily = serializedObject.fontFamily;
        }
        if (serializedObject.fontSize) {
            this.fontSize = serializedObject.fontSize;
        }
        if (serializedObject.fontWeight) {
            this.fontWeight = serializedObject.fontWeight;
        }
        if (serializedObject.fontStyle) {
            this.fontStyle = serializedObject.fontStyle;
        }
    };
    /** Releases associated resources */
    Control.prototype.dispose = function () {
        this.onDirtyObservable.clear();
        this.onBeforeDrawObservable.clear();
        this.onAfterDrawObservable.clear();
        this.onPointerDownObservable.clear();
        this.onPointerEnterObservable.clear();
        this.onPointerMoveObservable.clear();
        this.onPointerOutObservable.clear();
        this.onPointerUpObservable.clear();
        this.onPointerClickObservable.clear();
        this.onWheelObservable.clear();
        if (this._styleObserver && this._style) {
            this._style.onChangedObservable.remove(this._styleObserver);
            this._styleObserver = null;
        }
        if (this.parent) {
            this.parent.removeControl(this);
            this.parent = null;
        }
        if (this._host) {
            var index = this._host._linkedControls.indexOf(this);
            if (index > -1) {
                this.linkWithMesh(null);
            }
        }
        // Callback
        this.onDisposeObservable.notifyObservers(this);
        this.onDisposeObservable.clear();
    };
    Object.defineProperty(Control, "HORIZONTAL_ALIGNMENT_LEFT", {
        /** HORIZONTAL_ALIGNMENT_LEFT */
        get: function () {
            return Control._HORIZONTAL_ALIGNMENT_LEFT;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control, "HORIZONTAL_ALIGNMENT_RIGHT", {
        /** HORIZONTAL_ALIGNMENT_RIGHT */
        get: function () {
            return Control._HORIZONTAL_ALIGNMENT_RIGHT;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control, "HORIZONTAL_ALIGNMENT_CENTER", {
        /** HORIZONTAL_ALIGNMENT_CENTER */
        get: function () {
            return Control._HORIZONTAL_ALIGNMENT_CENTER;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control, "VERTICAL_ALIGNMENT_TOP", {
        /** VERTICAL_ALIGNMENT_TOP */
        get: function () {
            return Control._VERTICAL_ALIGNMENT_TOP;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control, "VERTICAL_ALIGNMENT_BOTTOM", {
        /** VERTICAL_ALIGNMENT_BOTTOM */
        get: function () {
            return Control._VERTICAL_ALIGNMENT_BOTTOM;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control, "VERTICAL_ALIGNMENT_CENTER", {
        /** VERTICAL_ALIGNMENT_CENTER */
        get: function () {
            return Control._VERTICAL_ALIGNMENT_CENTER;
        },
        enumerable: false,
        configurable: true
    });
    /**
     * @param font
     * @hidden
     */
    Control._GetFontOffset = function (font) {
        if (Control._FontHeightSizes[font]) {
            return Control._FontHeightSizes[font];
        }
        var engine = core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.EngineStore.LastCreatedEngine;
        if (!engine) {
            throw new Error("Invalid engine. Unable to create a canvas.");
        }
        var result = engine.getFontOffset(font);
        Control._FontHeightSizes[font] = result;
        return result;
    };
    /**
     * Creates a Control from parsed data
     * @param serializedObject defines parsed data
     * @param host defines the hosting AdvancedDynamicTexture
     * @returns a new Control
     */
    Control.Parse = function (serializedObject, host) {
        var controlType = core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Tools.Instantiate("BABYLON.GUI." + serializedObject.className);
        var control = core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.SerializationHelper.Parse(function () { return new controlType(); }, serializedObject, null);
        control.name = serializedObject.name;
        control._parseFromContent(serializedObject, host);
        return control;
    };
    /**
     * @param x
     * @param y
     * @param width
     * @param height
     * @param context
     * @hidden
     */
    Control.drawEllipse = function (x, y, width, height, context) {
        context.translate(x, y);
        context.scale(width, height);
        context.beginPath();
        context.arc(0, 0, 1, 0, 2 * Math.PI);
        context.closePath();
        context.scale(1 / width, 1 / height);
        context.translate(-x, -y);
    };
    /**
     * Gets or sets a boolean indicating if alpha must be an inherited value (false by default)
     */
    Control.AllowAlphaInheritance = false;
    Control._ClipMeasure = new _measure__WEBPACK_IMPORTED_MODULE_3__.Measure(0, 0, 0, 0);
    // Statics
    Control._HORIZONTAL_ALIGNMENT_LEFT = 0;
    Control._HORIZONTAL_ALIGNMENT_RIGHT = 1;
    Control._HORIZONTAL_ALIGNMENT_CENTER = 2;
    Control._VERTICAL_ALIGNMENT_TOP = 0;
    Control._VERTICAL_ALIGNMENT_BOTTOM = 1;
    Control._VERTICAL_ALIGNMENT_CENTER = 2;
    Control._FontHeightSizes = {};
    Control.AddHeader = function () { };
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "metadata", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "isHitTestVisible", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "isPointerBlocker", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "isFocusInvisible", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "clipChildren", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "clipContent", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "useBitmapCache", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "shadowOffsetX", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "shadowOffsetY", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "shadowBlur", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "shadowColor", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "hoverCursor", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "fontOffset", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "alpha", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "scaleX", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "scaleY", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "rotation", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "transformCenterY", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "transformCenterX", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "horizontalAlignment", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "verticalAlignment", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "fixedRatio", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "width", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "height", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "style", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "color", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "zIndex", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "notRenderable", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "isVisible", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "descendantsOnlyPadding", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "paddingLeft", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "paddingRight", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "paddingTop", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "paddingBottom", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "left", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "top", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "linkOffsetX", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "linkOffsetY", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "isEnabled", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "disabledColor", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "disabledColorItem", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "overlapGroup", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Control.prototype, "overlapDeltaMultiplier", void 0);
    return Control;
}());

(0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.RegisterClass)("BABYLON.GUI.Control", Control);


/***/ }),

/***/ "../../../lts/gui/dist/2D/controls/displayGrid.js":
/*!********************************************************!*\
  !*** ../../../lts/gui/dist/2D/controls/displayGrid.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "DisplayGrid": () => (/* binding */ DisplayGrid)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./control */ "../../../lts/gui/dist/2D/controls/control.js");
/* harmony import */ var core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core/Misc/decorators */ "core/Misc/observable");
/* harmony import */ var core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2__);




/** Class used to render a grid  */
var DisplayGrid = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(DisplayGrid, _super);
    /**
     * Creates a new GridDisplayRectangle
     * @param name defines the control name
     */
    function DisplayGrid(name) {
        var _this = _super.call(this, name) || this;
        _this.name = name;
        _this._cellWidth = 20;
        _this._cellHeight = 20;
        _this._minorLineTickness = 1;
        _this._minorLineColor = "DarkGray";
        _this._majorLineTickness = 2;
        _this._majorLineColor = "White";
        _this._majorLineFrequency = 5;
        _this._background = "Black";
        _this._displayMajorLines = true;
        _this._displayMinorLines = true;
        return _this;
    }
    Object.defineProperty(DisplayGrid.prototype, "displayMinorLines", {
        /** Gets or sets a boolean indicating if minor lines must be rendered (true by default)) */
        get: function () {
            return this._displayMinorLines;
        },
        set: function (value) {
            if (this._displayMinorLines === value) {
                return;
            }
            this._displayMinorLines = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DisplayGrid.prototype, "displayMajorLines", {
        /** Gets or sets a boolean indicating if major lines must be rendered (true by default)) */
        get: function () {
            return this._displayMajorLines;
        },
        set: function (value) {
            if (this._displayMajorLines === value) {
                return;
            }
            this._displayMajorLines = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DisplayGrid.prototype, "background", {
        /** Gets or sets background color (Black by default) */
        get: function () {
            return this._background;
        },
        set: function (value) {
            if (this._background === value) {
                return;
            }
            this._background = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DisplayGrid.prototype, "cellWidth", {
        /** Gets or sets the width of each cell (20 by default) */
        get: function () {
            return this._cellWidth;
        },
        set: function (value) {
            this._cellWidth = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DisplayGrid.prototype, "cellHeight", {
        /** Gets or sets the height of each cell (20 by default) */
        get: function () {
            return this._cellHeight;
        },
        set: function (value) {
            this._cellHeight = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DisplayGrid.prototype, "minorLineTickness", {
        /** Gets or sets the tickness of minor lines (1 by default) */
        get: function () {
            return this._minorLineTickness;
        },
        set: function (value) {
            this._minorLineTickness = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DisplayGrid.prototype, "minorLineColor", {
        /** Gets or sets the color of minor lines (DarkGray by default) */
        get: function () {
            return this._minorLineColor;
        },
        set: function (value) {
            this._minorLineColor = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DisplayGrid.prototype, "majorLineTickness", {
        /** Gets or sets the tickness of major lines (2 by default) */
        get: function () {
            return this._majorLineTickness;
        },
        set: function (value) {
            this._majorLineTickness = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DisplayGrid.prototype, "majorLineColor", {
        /** Gets or sets the color of major lines (White by default) */
        get: function () {
            return this._majorLineColor;
        },
        set: function (value) {
            this._majorLineColor = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DisplayGrid.prototype, "majorLineFrequency", {
        /** Gets or sets the frequency of major lines (default is 1 every 5 minor lines)*/
        get: function () {
            return this._majorLineFrequency;
        },
        set: function (value) {
            this._majorLineFrequency = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    DisplayGrid.prototype._draw = function (context) {
        context.save();
        this._applyStates(context);
        if (this._isEnabled) {
            if (this._background) {
                context.fillStyle = this._background;
                context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);
            }
            var cellCountX = this._currentMeasure.width / this._cellWidth;
            var cellCountY = this._currentMeasure.height / this._cellHeight;
            // Minor lines
            var left = this._currentMeasure.left + this._currentMeasure.width / 2;
            var top_1 = this._currentMeasure.top + this._currentMeasure.height / 2;
            if (this._displayMinorLines) {
                context.strokeStyle = this._minorLineColor;
                context.lineWidth = this._minorLineTickness;
                for (var x = -cellCountX / 2 + 1; x < cellCountX / 2; x++) {
                    var cellX = left + x * this.cellWidth;
                    context.beginPath();
                    context.moveTo(cellX, this._currentMeasure.top);
                    context.lineTo(cellX, this._currentMeasure.top + this._currentMeasure.height);
                    context.stroke();
                }
                for (var y = -cellCountY / 2 + 1; y < cellCountY / 2; y++) {
                    var cellY = top_1 + y * this.cellHeight;
                    context.beginPath();
                    context.moveTo(this._currentMeasure.left, cellY);
                    context.lineTo(this._currentMeasure.left + this._currentMeasure.width, cellY);
                    context.stroke();
                }
            }
            // Major lines
            if (this._displayMajorLines) {
                context.strokeStyle = this._majorLineColor;
                context.lineWidth = this._majorLineTickness;
                for (var x = -cellCountX / 2 + this._majorLineFrequency; x < cellCountX / 2; x += this._majorLineFrequency) {
                    var cellX = left + x * this.cellWidth;
                    context.beginPath();
                    context.moveTo(cellX, this._currentMeasure.top);
                    context.lineTo(cellX, this._currentMeasure.top + this._currentMeasure.height);
                    context.stroke();
                }
                for (var y = -cellCountY / 2 + this._majorLineFrequency; y < cellCountY / 2; y += this._majorLineFrequency) {
                    var cellY = top_1 + y * this.cellHeight;
                    context.moveTo(this._currentMeasure.left, cellY);
                    context.lineTo(this._currentMeasure.left + this._currentMeasure.width, cellY);
                    context.closePath();
                    context.stroke();
                }
            }
        }
        context.restore();
    };
    DisplayGrid.prototype._getTypeName = function () {
        return "DisplayGrid";
    };
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2__.serialize)()
    ], DisplayGrid.prototype, "displayMinorLines", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2__.serialize)()
    ], DisplayGrid.prototype, "displayMajorLines", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2__.serialize)()
    ], DisplayGrid.prototype, "background", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2__.serialize)()
    ], DisplayGrid.prototype, "cellWidth", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2__.serialize)()
    ], DisplayGrid.prototype, "cellHeight", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2__.serialize)()
    ], DisplayGrid.prototype, "minorLineTickness", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2__.serialize)()
    ], DisplayGrid.prototype, "minorLineColor", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2__.serialize)()
    ], DisplayGrid.prototype, "majorLineTickness", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2__.serialize)()
    ], DisplayGrid.prototype, "majorLineColor", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2__.serialize)()
    ], DisplayGrid.prototype, "majorLineFrequency", null);
    return DisplayGrid;
}(_control__WEBPACK_IMPORTED_MODULE_1__.Control));

(0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2__.RegisterClass)("BABYLON.GUI.DisplayGrid", DisplayGrid);


/***/ }),

/***/ "../../../lts/gui/dist/2D/controls/ellipse.js":
/*!****************************************************!*\
  !*** ../../../lts/gui/dist/2D/controls/ellipse.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Ellipse": () => (/* binding */ Ellipse)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var _container__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./container */ "../../../lts/gui/dist/2D/controls/container.js");
/* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./control */ "../../../lts/gui/dist/2D/controls/control.js");
/* harmony import */ var core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core/Misc/decorators */ "core/Misc/observable");
/* harmony import */ var core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_3__);





/** Class used to create 2D ellipse containers */
var Ellipse = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(Ellipse, _super);
    /**
     * Creates a new Ellipse
     * @param name defines the control name
     */
    function Ellipse(name) {
        var _this = _super.call(this, name) || this;
        _this.name = name;
        _this._thickness = 1;
        return _this;
    }
    Object.defineProperty(Ellipse.prototype, "thickness", {
        /** Gets or sets border thickness */
        get: function () {
            return this._thickness;
        },
        set: function (value) {
            if (this._thickness === value) {
                return;
            }
            this._thickness = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Ellipse.prototype._getTypeName = function () {
        return "Ellipse";
    };
    Ellipse.prototype._localDraw = function (context) {
        context.save();
        if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
            context.shadowColor = this.shadowColor;
            context.shadowBlur = this.shadowBlur;
            context.shadowOffsetX = this.shadowOffsetX;
            context.shadowOffsetY = this.shadowOffsetY;
        }
        _control__WEBPACK_IMPORTED_MODULE_2__.Control.drawEllipse(this._currentMeasure.left + this._currentMeasure.width / 2, this._currentMeasure.top + this._currentMeasure.height / 2, this._currentMeasure.width / 2 - this._thickness / 2, this._currentMeasure.height / 2 - this._thickness / 2, context);
        if (this._background) {
            context.fillStyle = this._background;
            context.fill();
        }
        if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
            context.shadowBlur = 0;
            context.shadowOffsetX = 0;
            context.shadowOffsetY = 0;
        }
        if (this._thickness) {
            if (this.color) {
                context.strokeStyle = this.color;
            }
            context.lineWidth = this._thickness;
            context.stroke();
        }
        context.restore();
    };
    Ellipse.prototype._additionalProcessing = function (parentMeasure, context) {
        _super.prototype._additionalProcessing.call(this, parentMeasure, context);
        this._measureForChildren.width -= 2 * this._thickness;
        this._measureForChildren.height -= 2 * this._thickness;
        this._measureForChildren.left += this._thickness;
        this._measureForChildren.top += this._thickness;
    };
    Ellipse.prototype._clipForChildren = function (context) {
        _control__WEBPACK_IMPORTED_MODULE_2__.Control.drawEllipse(this._currentMeasure.left + this._currentMeasure.width / 2, this._currentMeasure.top + this._currentMeasure.height / 2, this._currentMeasure.width / 2, this._currentMeasure.height / 2, context);
        context.clip();
    };
    Ellipse.prototype._renderHighlightSpecific = function (context) {
        _control__WEBPACK_IMPORTED_MODULE_2__.Control.drawEllipse(this._currentMeasure.left + this._currentMeasure.width / 2, this._currentMeasure.top + this._currentMeasure.height / 2, this._currentMeasure.width / 2 - this._highlightLineWidth / 2, this._currentMeasure.height / 2 - this._highlightLineWidth / 2, context);
        context.stroke();
    };
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_3__.serialize)()
    ], Ellipse.prototype, "thickness", null);
    return Ellipse;
}(_container__WEBPACK_IMPORTED_MODULE_1__.Container));

(0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_3__.RegisterClass)("BABYLON.GUI.Ellipse", Ellipse);


/***/ }),

/***/ "../../../lts/gui/dist/2D/controls/focusableButton.js":
/*!************************************************************!*\
  !*** ../../../lts/gui/dist/2D/controls/focusableButton.js ***!
  \************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "FocusableButton": () => (/* binding */ FocusableButton)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./button */ "../../../lts/gui/dist/2D/controls/button.js");
/* harmony import */ var core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core/Misc/observable */ "core/Misc/observable");
/* harmony import */ var core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2__);




/**
 * Class used to create a focusable button that can easily handle keyboard events
 * @since 5.0.0
 */
var FocusableButton = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(FocusableButton, _super);
    function FocusableButton(name) {
        var _this = _super.call(this, name) || this;
        _this.name = name;
        /** Highlight color when button is focused */
        _this.focusedColor = null;
        _this._isFocused = false;
        _this._unfocusedColor = null;
        /** Observable raised when the control gets the focus */
        _this.onFocusObservable = new core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2__.Observable();
        /** Observable raised when the control loses the focus */
        _this.onBlurObservable = new core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2__.Observable();
        /** Observable raised when a key event was processed */
        _this.onKeyboardEventProcessedObservable = new core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2__.Observable();
        _this._unfocusedColor = _this.color;
        return _this;
    }
    /** @hidden */
    FocusableButton.prototype.onBlur = function () {
        if (this._isFocused) {
            this._isFocused = false;
            if (this.focusedColor && this._unfocusedColor != null) {
                // Set color back to saved unfocused color
                this.color = this._unfocusedColor;
            }
            this.onBlurObservable.notifyObservers(this);
        }
    };
    /** @hidden */
    FocusableButton.prototype.onFocus = function () {
        this._isFocused = true;
        if (this.focusedColor) {
            // Save the unfocused color
            this._unfocusedColor = this.color;
            this.color = this.focusedColor;
        }
        this.onFocusObservable.notifyObservers(this);
    };
    /**
     * Function called to get the list of controls that should not steal the focus from this control
     * @returns an array of controls
     */
    FocusableButton.prototype.keepsFocusWith = function () {
        return null;
    };
    /**
     * Function to focus a button programmatically
     */
    FocusableButton.prototype.focus = function () {
        this._host.moveFocusToControl(this);
    };
    /**
     * Function to unfocus a button programmatically
     */
    FocusableButton.prototype.blur = function () {
        this._host.focusedControl = null;
    };
    /**
     * Handles the keyboard event
     * @param evt Defines the KeyboardEvent
     */
    FocusableButton.prototype.processKeyboard = function (evt) {
        this.onKeyboardEventProcessedObservable.notifyObservers(evt, -1, this);
    };
    /**
     * @param target
     * @param coordinates
     * @param pointerId
     * @param buttonIndex
     * @param pi
     * @hidden
     */
    FocusableButton.prototype._onPointerDown = function (target, coordinates, pointerId, buttonIndex, pi) {
        if (!this.isReadOnly) {
            // Clicking on button should focus
            this.focus();
        }
        return _super.prototype._onPointerDown.call(this, target, coordinates, pointerId, buttonIndex, pi);
    };
    /** @hidden */
    FocusableButton.prototype.displose = function () {
        _super.prototype.dispose.call(this);
        this.onBlurObservable.clear();
        this.onFocusObservable.clear();
        this.onKeyboardEventProcessedObservable.clear();
    };
    return FocusableButton;
}(_button__WEBPACK_IMPORTED_MODULE_1__.Button));

(0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2__.RegisterClass)("BABYLON.GUI.FocusableButton", FocusableButton);


/***/ }),

/***/ "../../../lts/gui/dist/2D/controls/focusableControl.js":
/*!*************************************************************!*\
  !*** ../../../lts/gui/dist/2D/controls/focusableControl.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);



/***/ }),

/***/ "../../../lts/gui/dist/2D/controls/grid.js":
/*!*************************************************!*\
  !*** ../../../lts/gui/dist/2D/controls/grid.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Grid": () => (/* binding */ Grid)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var _container__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./container */ "../../../lts/gui/dist/2D/controls/container.js");
/* harmony import */ var _valueAndUnit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../valueAndUnit */ "../../../lts/gui/dist/2D/valueAndUnit.js");
/* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./control */ "../../../lts/gui/dist/2D/controls/control.js");
/* harmony import */ var core_Misc_tools__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core/Misc/typeStore */ "core/Misc/observable");
/* harmony import */ var core_Misc_tools__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_Misc_tools__WEBPACK_IMPORTED_MODULE_4__);






/**
 * Class used to create a 2D grid container
 */
var Grid = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(Grid, _super);
    /**
     * Creates a new Grid
     * @param name defines control name
     */
    function Grid(name) {
        var _this = _super.call(this, name) || this;
        _this.name = name;
        _this._rowDefinitions = new Array();
        _this._rowDefinitionObservers = [];
        _this._columnDefinitions = new Array();
        _this._columnDefinitionObservers = [];
        _this._cells = {};
        _this._childControls = new Array();
        return _this;
    }
    Object.defineProperty(Grid.prototype, "columnCount", {
        /**
         * Gets the number of columns
         */
        get: function () {
            return this._columnDefinitions.length;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Grid.prototype, "rowCount", {
        /**
         * Gets the number of rows
         */
        get: function () {
            return this._rowDefinitions.length;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Grid.prototype, "children", {
        /** Gets the list of children */
        get: function () {
            return this._childControls;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Grid.prototype, "cells", {
        /** Gets the list of cells (e.g. the containers) */
        get: function () {
            return this._cells;
        },
        enumerable: false,
        configurable: true
    });
    /**
     * Gets the definition of a specific row
     * @param index defines the index of the row
     * @returns the row definition
     */
    Grid.prototype.getRowDefinition = function (index) {
        if (index < 0 || index >= this._rowDefinitions.length) {
            return null;
        }
        return this._rowDefinitions[index];
    };
    /**
     * Gets the definition of a specific column
     * @param index defines the index of the column
     * @returns the column definition
     */
    Grid.prototype.getColumnDefinition = function (index) {
        if (index < 0 || index >= this._columnDefinitions.length) {
            return null;
        }
        return this._columnDefinitions[index];
    };
    /**
     * Adds a new row to the grid
     * @param height defines the height of the row (either in pixel or a value between 0 and 1)
     * @param isPixel defines if the height is expressed in pixel (or in percentage)
     * @returns the current grid
     */
    Grid.prototype.addRowDefinition = function (height, isPixel) {
        var _this = this;
        if (isPixel === void 0) { isPixel = false; }
        this._rowDefinitions.push(new _valueAndUnit__WEBPACK_IMPORTED_MODULE_2__.ValueAndUnit(height, isPixel ? _valueAndUnit__WEBPACK_IMPORTED_MODULE_2__.ValueAndUnit.UNITMODE_PIXEL : _valueAndUnit__WEBPACK_IMPORTED_MODULE_2__.ValueAndUnit.UNITMODE_PERCENTAGE));
        this._rowDefinitionObservers.push(this._rowDefinitions[this.rowCount - 1].onChangedObservable.add(function () { return _this._markAsDirty(); }));
        this._markAsDirty();
        return this;
    };
    /**
     * Adds a new column to the grid
     * @param width defines the width of the column (either in pixel or a value between 0 and 1)
     * @param isPixel defines if the width is expressed in pixel (or in percentage)
     * @returns the current grid
     */
    Grid.prototype.addColumnDefinition = function (width, isPixel) {
        var _this = this;
        if (isPixel === void 0) { isPixel = false; }
        this._columnDefinitions.push(new _valueAndUnit__WEBPACK_IMPORTED_MODULE_2__.ValueAndUnit(width, isPixel ? _valueAndUnit__WEBPACK_IMPORTED_MODULE_2__.ValueAndUnit.UNITMODE_PIXEL : _valueAndUnit__WEBPACK_IMPORTED_MODULE_2__.ValueAndUnit.UNITMODE_PERCENTAGE));
        this._columnDefinitionObservers.push(this._columnDefinitions[this.columnCount - 1].onChangedObservable.add(function () { return _this._markAsDirty(); }));
        this._markAsDirty();
        return this;
    };
    /**
     * Update a row definition
     * @param index defines the index of the row to update
     * @param height defines the height of the row (either in pixel or a value between 0 and 1)
     * @param isPixel defines if the weight is expressed in pixel (or in percentage)
     * @returns the current grid
     */
    Grid.prototype.setRowDefinition = function (index, height, isPixel) {
        var _this = this;
        if (isPixel === void 0) { isPixel = false; }
        if (index < 0 || index >= this._rowDefinitions.length) {
            return this;
        }
        var current = this._rowDefinitions[index];
        if (current && current.isPixel === isPixel && current.value === height) {
            return this;
        }
        this._rowDefinitions[index].onChangedObservable.remove(this._rowDefinitionObservers[index]);
        this._rowDefinitions[index] = new _valueAndUnit__WEBPACK_IMPORTED_MODULE_2__.ValueAndUnit(height, isPixel ? _valueAndUnit__WEBPACK_IMPORTED_MODULE_2__.ValueAndUnit.UNITMODE_PIXEL : _valueAndUnit__WEBPACK_IMPORTED_MODULE_2__.ValueAndUnit.UNITMODE_PERCENTAGE);
        this._rowDefinitionObservers[index] = this._rowDefinitions[index].onChangedObservable.add(function () { return _this._markAsDirty(); });
        this._markAsDirty();
        return this;
    };
    /**
     * Update a column definition
     * @param index defines the index of the column to update
     * @param width defines the width of the column (either in pixel or a value between 0 and 1)
     * @param isPixel defines if the width is expressed in pixel (or in percentage)
     * @returns the current grid
     */
    Grid.prototype.setColumnDefinition = function (index, width, isPixel) {
        var _this = this;
        if (isPixel === void 0) { isPixel = false; }
        if (index < 0 || index >= this._columnDefinitions.length) {
            return this;
        }
        var current = this._columnDefinitions[index];
        if (current && current.isPixel === isPixel && current.value === width) {
            return this;
        }
        this._columnDefinitions[index].onChangedObservable.remove(this._columnDefinitionObservers[index]);
        this._columnDefinitions[index] = new _valueAndUnit__WEBPACK_IMPORTED_MODULE_2__.ValueAndUnit(width, isPixel ? _valueAndUnit__WEBPACK_IMPORTED_MODULE_2__.ValueAndUnit.UNITMODE_PIXEL : _valueAndUnit__WEBPACK_IMPORTED_MODULE_2__.ValueAndUnit.UNITMODE_PERCENTAGE);
        this._columnDefinitionObservers[index] = this._columnDefinitions[index].onChangedObservable.add(function () { return _this._markAsDirty(); });
        this._markAsDirty();
        return this;
    };
    /**
     * Gets the list of children stored in a specific cell
     * @param row defines the row to check
     * @param column defines the column to check
     * @returns the list of controls
     */
    Grid.prototype.getChildrenAt = function (row, column) {
        var cell = this._cells["".concat(row, ":").concat(column)];
        if (!cell) {
            return null;
        }
        return cell.children;
    };
    /**
     * Gets a string representing the child cell info (row x column)
     * @param child defines the control to get info from
     * @returns a string containing the child cell info (row x column)
     */
    Grid.prototype.getChildCellInfo = function (child) {
        return child._tag;
    };
    Grid.prototype._removeCell = function (cell, key) {
        if (!cell) {
            return;
        }
        _super.prototype.removeControl.call(this, cell);
        for (var _i = 0, _a = cell.children; _i < _a.length; _i++) {
            var control = _a[_i];
            var childIndex = this._childControls.indexOf(control);
            if (childIndex !== -1) {
                this._childControls.splice(childIndex, 1);
            }
        }
        delete this._cells[key];
    };
    Grid.prototype._offsetCell = function (previousKey, key) {
        if (!this._cells[key]) {
            return;
        }
        this._cells[previousKey] = this._cells[key];
        for (var _i = 0, _a = this._cells[previousKey].children; _i < _a.length; _i++) {
            var control = _a[_i];
            control._tag = previousKey;
        }
        delete this._cells[key];
    };
    /**
     * Remove a column definition at specified index
     * @param index defines the index of the column to remove
     * @returns the current grid
     */
    Grid.prototype.removeColumnDefinition = function (index) {
        if (index < 0 || index >= this._columnDefinitions.length) {
            return this;
        }
        for (var x = 0; x < this._rowDefinitions.length; x++) {
            var key = "".concat(x, ":").concat(index);
            var cell = this._cells[key];
            this._removeCell(cell, key);
        }
        for (var x = 0; x < this._rowDefinitions.length; x++) {
            for (var y = index + 1; y < this._columnDefinitions.length; y++) {
                var previousKey = "".concat(x, ":").concat(y - 1);
                var key = "".concat(x, ":").concat(y);
                this._offsetCell(previousKey, key);
            }
        }
        this._columnDefinitions[index].onChangedObservable.remove(this._columnDefinitionObservers[index]);
        this._columnDefinitions.splice(index, 1);
        this._columnDefinitionObservers.splice(index, 1);
        this._markAsDirty();
        return this;
    };
    /**
     * Remove a row definition at specified index
     * @param index defines the index of the row to remove
     * @returns the current grid
     */
    Grid.prototype.removeRowDefinition = function (index) {
        if (index < 0 || index >= this._rowDefinitions.length) {
            return this;
        }
        for (var y = 0; y < this._columnDefinitions.length; y++) {
            var key = "".concat(index, ":").concat(y);
            var cell = this._cells[key];
            this._removeCell(cell, key);
        }
        for (var y = 0; y < this._columnDefinitions.length; y++) {
            for (var x = index + 1; x < this._rowDefinitions.length; x++) {
                var previousKey = "".concat(x - 1, ":").concat(y);
                var key = "".concat(x, ":").concat(y);
                this._offsetCell(previousKey, key);
            }
        }
        this._rowDefinitions[index].onChangedObservable.remove(this._rowDefinitionObservers[index]);
        this._rowDefinitions.splice(index, 1);
        this._rowDefinitionObservers.splice(index, 1);
        this._markAsDirty();
        return this;
    };
    /**
     * Adds a new control to the current grid
     * @param control defines the control to add
     * @param row defines the row where to add the control (0 by default)
     * @param column defines the column where to add the control (0 by default)
     * @returns the current grid
     */
    Grid.prototype.addControl = function (control, row, column) {
        if (row === void 0) { row = 0; }
        if (column === void 0) { column = 0; }
        if (this._rowDefinitions.length === 0) {
            // Add default row definition
            this.addRowDefinition(1, false);
        }
        if (this._columnDefinitions.length === 0) {
            // Add default column definition
            this.addColumnDefinition(1, false);
        }
        if (this._childControls.indexOf(control) !== -1) {
            core_Misc_tools__WEBPACK_IMPORTED_MODULE_4__.Tools.Warn("Control (Name:".concat(control.name, ", UniqueId:").concat(control.uniqueId, ") is already associated with this grid. You must remove it before reattaching it"));
            return this;
        }
        var x = Math.min(row, this._rowDefinitions.length - 1);
        var y = Math.min(column, this._columnDefinitions.length - 1);
        var key = "".concat(x, ":").concat(y);
        var goodContainer = this._cells[key];
        if (!goodContainer) {
            goodContainer = new _container__WEBPACK_IMPORTED_MODULE_1__.Container(key);
            this._cells[key] = goodContainer;
            goodContainer.horizontalAlignment = _control__WEBPACK_IMPORTED_MODULE_3__.Control.HORIZONTAL_ALIGNMENT_LEFT;
            goodContainer.verticalAlignment = _control__WEBPACK_IMPORTED_MODULE_3__.Control.VERTICAL_ALIGNMENT_TOP;
            _super.prototype.addControl.call(this, goodContainer);
        }
        goodContainer.addControl(control);
        this._childControls.push(control);
        control._tag = key;
        control.parent = this;
        this._markAsDirty();
        return this;
    };
    /**
     * Removes a control from the current container
     * @param control defines the control to remove
     * @returns the current container
     */
    Grid.prototype.removeControl = function (control) {
        var index = this._childControls.indexOf(control);
        if (index !== -1) {
            this._childControls.splice(index, 1);
        }
        var cell = this._cells[control._tag];
        if (cell) {
            cell.removeControl(control);
            control._tag = null;
        }
        this._markAsDirty();
        return this;
    };
    Grid.prototype._getTypeName = function () {
        return "Grid";
    };
    Grid.prototype._getGridDefinitions = function (definitionCallback) {
        var widths = [];
        var heights = [];
        var lefts = [];
        var tops = [];
        var availableWidth = this._currentMeasure.width;
        var globalWidthPercentage = 0;
        var availableHeight = this._currentMeasure.height;
        var globalHeightPercentage = 0;
        // Heights
        var index = 0;
        for (var _i = 0, _a = this._rowDefinitions; _i < _a.length; _i++) {
            var rowDefinition = _a[_i];
            if (rowDefinition.isPixel) {
                var height = rowDefinition.getValue(this._host);
                availableHeight -= height;
                heights[index] = height;
            }
            else {
                globalHeightPercentage += rowDefinition.value;
            }
            index++;
        }
        var top = 0;
        index = 0;
        for (var _b = 0, _c = this._rowDefinitions; _b < _c.length; _b++) {
            var rowDefinition = _c[_b];
            tops.push(top);
            if (!rowDefinition.isPixel) {
                var height = (rowDefinition.value / globalHeightPercentage) * availableHeight;
                top += height;
                heights[index] = height;
            }
            else {
                top += rowDefinition.getValue(this._host);
            }
            index++;
        }
        // Widths
        index = 0;
        for (var _d = 0, _e = this._columnDefinitions; _d < _e.length; _d++) {
            var columnDefinition = _e[_d];
            if (columnDefinition.isPixel) {
                var width = columnDefinition.getValue(this._host);
                availableWidth -= width;
                widths[index] = width;
            }
            else {
                globalWidthPercentage += columnDefinition.value;
            }
            index++;
        }
        var left = 0;
        index = 0;
        for (var _f = 0, _g = this._columnDefinitions; _f < _g.length; _f++) {
            var columnDefinition = _g[_f];
            lefts.push(left);
            if (!columnDefinition.isPixel) {
                var width = (columnDefinition.value / globalWidthPercentage) * availableWidth;
                left += width;
                widths[index] = width;
            }
            else {
                left += columnDefinition.getValue(this._host);
            }
            index++;
        }
        definitionCallback(lefts, tops, widths, heights);
    };
    Grid.prototype._additionalProcessing = function (parentMeasure, context) {
        var _this = this;
        this._getGridDefinitions(function (lefts, tops, widths, heights) {
            // Setting child sizes
            for (var key in _this._cells) {
                if (!Object.prototype.hasOwnProperty.call(_this._cells, key)) {
                    continue;
                }
                var split = key.split(":");
                var x = parseInt(split[0]);
                var y = parseInt(split[1]);
                var cell = _this._cells[key];
                cell.left = lefts[y] + "px";
                cell.top = tops[x] + "px";
                cell.width = widths[y] + "px";
                cell.height = heights[x] + "px";
                cell._left.ignoreAdaptiveScaling = true;
                cell._top.ignoreAdaptiveScaling = true;
                cell._width.ignoreAdaptiveScaling = true;
                cell._height.ignoreAdaptiveScaling = true;
            }
        });
        _super.prototype._additionalProcessing.call(this, parentMeasure, context);
    };
    Grid.prototype._flagDescendantsAsMatrixDirty = function () {
        for (var key in this._cells) {
            if (!Object.prototype.hasOwnProperty.call(this._cells, key)) {
                continue;
            }
            var child = this._cells[key];
            child._markMatrixAsDirty();
        }
    };
    Grid.prototype._renderHighlightSpecific = function (context) {
        var _this = this;
        _super.prototype._renderHighlightSpecific.call(this, context);
        this._getGridDefinitions(function (lefts, tops, widths, heights) {
            // Columns
            for (var index = 0; index < lefts.length; index++) {
                var left = _this._currentMeasure.left + lefts[index] + widths[index];
                context.beginPath();
                context.moveTo(left, _this._currentMeasure.top);
                context.lineTo(left, _this._currentMeasure.top + _this._currentMeasure.height);
                context.stroke();
            }
            // Rows
            for (var index = 0; index < tops.length; index++) {
                var top_1 = _this._currentMeasure.top + tops[index] + heights[index];
                context.beginPath();
                context.moveTo(_this._currentMeasure.left, top_1);
                context.lineTo(_this._currentMeasure.left + _this._currentMeasure.width, top_1);
                context.stroke();
            }
        });
        context.restore();
    };
    /** Releases associated resources */
    Grid.prototype.dispose = function () {
        _super.prototype.dispose.call(this);
        for (var _i = 0, _a = this._childControls; _i < _a.length; _i++) {
            var control = _a[_i];
            control.dispose();
        }
        for (var index = 0; index < this._rowDefinitions.length; index++) {
            this._rowDefinitions[index].onChangedObservable.remove(this._rowDefinitionObservers[index]);
        }
        for (var index = 0; index < this._columnDefinitions.length; index++) {
            this._columnDefinitions[index].onChangedObservable.remove(this._columnDefinitionObservers[index]);
        }
        this._rowDefinitionObservers = [];
        this._rowDefinitions = [];
        this._columnDefinitionObservers = [];
        this._columnDefinitions = [];
        this._cells = {};
        this._childControls = [];
    };
    /**
     * Serializes the current control
     * @param serializationObject defined the JSON serialized object
     */
    Grid.prototype.serialize = function (serializationObject) {
        _super.prototype.serialize.call(this, serializationObject);
        serializationObject.columnCount = this.columnCount;
        serializationObject.rowCount = this.rowCount;
        serializationObject.columns = [];
        serializationObject.rows = [];
        serializationObject.tags = [];
        for (var i = 0; i < this.columnCount; ++i) {
            var cd = this.getColumnDefinition(i);
            var childSerializationObject = { value: cd === null || cd === void 0 ? void 0 : cd.getValue(this.host), unit: cd === null || cd === void 0 ? void 0 : cd.unit };
            serializationObject.columns.push(childSerializationObject);
        }
        for (var i = 0; i < this.rowCount; ++i) {
            var rd = this.getRowDefinition(i);
            var childSerializationObject = { value: rd === null || rd === void 0 ? void 0 : rd.getValue(this.host), unit: rd === null || rd === void 0 ? void 0 : rd.unit };
            serializationObject.rows.push(childSerializationObject);
        }
        this.children.forEach(function (child) {
            serializationObject.tags.push(child._tag);
        });
    };
    /**
     * @param serializedObject
     * @param host
     * @hidden
     */
    Grid.prototype._parseFromContent = function (serializedObject, host) {
        _super.prototype._parseFromContent.call(this, serializedObject, host);
        var children = [];
        this.children.forEach(function (child) {
            children.push(child);
        });
        this.removeRowDefinition(0);
        this.removeColumnDefinition(0);
        for (var i = 0; i < serializedObject.columnCount; ++i) {
            var columnValue = serializedObject.columns[i].value;
            var unit = serializedObject.columns[i].unit;
            this.addColumnDefinition(columnValue, unit === 1 ? true : false);
        }
        for (var i = 0; i < serializedObject.rowCount; ++i) {
            var rowValue = serializedObject.rows[i].value;
            var unit = serializedObject.rows[i].unit;
            this.addRowDefinition(rowValue, unit === 1 ? true : false);
        }
        for (var i = 0; i < children.length; ++i) {
            var cellInfo = serializedObject.tags[i];
            var rowNumber = parseInt(cellInfo.substring(0, cellInfo.search(":")));
            if (isNaN(rowNumber)) {
                rowNumber = 0;
            }
            var columnNumber = parseInt(cellInfo.substring(cellInfo.search(":") + 1));
            if (isNaN(columnNumber)) {
                columnNumber = 0;
            }
            this.addControl(children[i], rowNumber, columnNumber);
        }
    };
    return Grid;
}(_container__WEBPACK_IMPORTED_MODULE_1__.Container));

(0,core_Misc_tools__WEBPACK_IMPORTED_MODULE_4__.RegisterClass)("BABYLON.GUI.Grid", Grid);


/***/ }),

/***/ "../../../lts/gui/dist/2D/controls/image.js":
/*!**************************************************!*\
  !*** ../../../lts/gui/dist/2D/controls/image.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Image": () => (/* binding */ Image)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Engines/engineStore */ "core/Misc/observable");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./control */ "../../../lts/gui/dist/2D/controls/control.js");







/**
 * Class used to create 2D images
 */
var Image = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(Image, _super);
    /**
     * Creates a new Image
     * @param name defines the control name
     * @param url defines the image url
     */
    function Image(name, url) {
        if (url === void 0) { url = null; }
        var _this = _super.call(this, name) || this;
        _this.name = name;
        _this._workingCanvas = null;
        _this._loaded = false;
        _this._stretch = Image.STRETCH_FILL;
        _this._autoScale = false;
        _this._sourceLeft = 0;
        _this._sourceTop = 0;
        _this._sourceWidth = 0;
        _this._sourceHeight = 0;
        _this._svgAttributesComputationCompleted = false;
        _this._isSVG = false;
        _this._cellWidth = 0;
        _this._cellHeight = 0;
        _this._cellId = -1;
        _this._populateNinePatchSlicesFromImage = false;
        _this._imageDataCache = { data: null, key: "" };
        /**
         * Observable notified when the content is loaded
         */
        _this.onImageLoadedObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        /**
         * Observable notified when _sourceLeft, _sourceTop, _sourceWidth and _sourceHeight are computed
         */
        _this.onSVGAttributesComputedObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        _this.source = url;
        return _this;
    }
    Object.defineProperty(Image.prototype, "isLoaded", {
        /**
         * Gets a boolean indicating that the content is loaded
         */
        get: function () {
            return this._loaded;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Image.prototype, "detectPointerOnOpaqueOnly", {
        /**
         * Gets or sets a boolean indicating if pointers should only be validated on pixels with alpha > 0.
         * Beware using this as this will consume more memory as the image has to be stored twice
         */
        get: function () {
            return this._detectPointerOnOpaqueOnly;
        },
        set: function (value) {
            if (this._detectPointerOnOpaqueOnly === value) {
                return;
            }
            this._detectPointerOnOpaqueOnly = value;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Image.prototype, "sliceLeft", {
        /**
         * Gets or sets the left value for slicing (9-patch)
         */
        get: function () {
            return this._sliceLeft;
        },
        set: function (value) {
            if (this._sliceLeft === value) {
                return;
            }
            this._sliceLeft = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Image.prototype, "sliceRight", {
        /**
         * Gets or sets the right value for slicing (9-patch)
         */
        get: function () {
            return this._sliceRight;
        },
        set: function (value) {
            if (this._sliceRight === value) {
                return;
            }
            this._sliceRight = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Image.prototype, "sliceTop", {
        /**
         * Gets or sets the top value for slicing (9-patch)
         */
        get: function () {
            return this._sliceTop;
        },
        set: function (value) {
            if (this._sliceTop === value) {
                return;
            }
            this._sliceTop = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Image.prototype, "sliceBottom", {
        /**
         * Gets or sets the bottom value for slicing (9-patch)
         */
        get: function () {
            return this._sliceBottom;
        },
        set: function (value) {
            if (this._sliceBottom === value) {
                return;
            }
            this._sliceBottom = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Image.prototype, "sourceLeft", {
        /**
         * Gets or sets the left coordinate in the source image
         */
        get: function () {
            return this._sourceLeft;
        },
        set: function (value) {
            if (this._sourceLeft === value) {
                return;
            }
            this._sourceLeft = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Image.prototype, "sourceTop", {
        /**
         * Gets or sets the top coordinate in the source image
         */
        get: function () {
            return this._sourceTop;
        },
        set: function (value) {
            if (this._sourceTop === value) {
                return;
            }
            this._sourceTop = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Image.prototype, "sourceWidth", {
        /**
         * Gets or sets the width to capture in the source image
         */
        get: function () {
            return this._sourceWidth;
        },
        set: function (value) {
            if (this._sourceWidth === value) {
                return;
            }
            this._sourceWidth = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Image.prototype, "sourceHeight", {
        /**
         * Gets or sets the height to capture in the source image
         */
        get: function () {
            return this._sourceHeight;
        },
        set: function (value) {
            if (this._sourceHeight === value) {
                return;
            }
            this._sourceHeight = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Image.prototype, "imageWidth", {
        /**
         * Gets the image width
         */
        get: function () {
            return this._imageWidth;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Image.prototype, "imageHeight", {
        /**
         * Gets the image height
         */
        get: function () {
            return this._imageHeight;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Image.prototype, "populateNinePatchSlicesFromImage", {
        /**
         * Gets or sets a boolean indicating if nine patch slices (left, top, right, bottom) should be read from image data
         */
        get: function () {
            return this._populateNinePatchSlicesFromImage;
        },
        set: function (value) {
            if (this._populateNinePatchSlicesFromImage === value) {
                return;
            }
            this._populateNinePatchSlicesFromImage = value;
            if (this._populateNinePatchSlicesFromImage && this._loaded) {
                this._extractNinePatchSliceDataFromImage();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Image.prototype, "isSVG", {
        /** Indicates if the format of the image is SVG */
        get: function () {
            return this._isSVG;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Image.prototype, "svgAttributesComputationCompleted", {
        /** Gets the status of the SVG attributes computation (sourceLeft, sourceTop, sourceWidth, sourceHeight) */
        get: function () {
            return this._svgAttributesComputationCompleted;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Image.prototype, "autoScale", {
        /**
         * Gets or sets a boolean indicating if the image can force its container to adapt its size
         * @see https://doc.babylonjs.com/how_to/gui#image
         */
        get: function () {
            return this._autoScale;
        },
        set: function (value) {
            if (this._autoScale === value) {
                return;
            }
            this._autoScale = value;
            if (value && this._loaded) {
                this.synchronizeSizeWithContent();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Image.prototype, "stretch", {
        /** Gets or sets the stretching mode used by the image */
        get: function () {
            return this._stretch;
        },
        set: function (value) {
            if (this._stretch === value) {
                return;
            }
            this._stretch = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    /**
     * @param n
     * @param preserveProperties
     * @hidden
     */
    Image.prototype._rotate90 = function (n, preserveProperties) {
        var _a, _b;
        if (preserveProperties === void 0) { preserveProperties = false; }
        var width = this._domImage.width;
        var height = this._domImage.height;
        // Should abstract platform instead of using LastCreatedEngine
        var engine = ((_b = (_a = this._host) === null || _a === void 0 ? void 0 : _a.getScene()) === null || _b === void 0 ? void 0 : _b.getEngine()) || core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.EngineStore.LastCreatedEngine;
        if (!engine) {
            throw new Error("Invalid engine. Unable to create a canvas.");
        }
        var canvas = engine.createCanvas(height, width);
        var context = canvas.getContext("2d");
        context.translate(canvas.width / 2, canvas.height / 2);
        context.rotate((n * Math.PI) / 2);
        context.drawImage(this._domImage, 0, 0, width, height, -width / 2, -height / 2, width, height);
        var dataUrl = canvas.toDataURL("image/jpg");
        var rotatedImage = new Image(this.name + "rotated", dataUrl);
        if (preserveProperties) {
            rotatedImage._stretch = this._stretch;
            rotatedImage._autoScale = this._autoScale;
            rotatedImage._cellId = this._cellId;
            rotatedImage._cellWidth = n % 1 ? this._cellHeight : this._cellWidth;
            rotatedImage._cellHeight = n % 1 ? this._cellWidth : this._cellHeight;
        }
        this._handleRotationForSVGImage(this, rotatedImage, n);
        this._imageDataCache.data = null;
        return rotatedImage;
    };
    Image.prototype._handleRotationForSVGImage = function (srcImage, dstImage, n) {
        var _this = this;
        if (!srcImage._isSVG) {
            return;
        }
        if (srcImage._svgAttributesComputationCompleted) {
            this._rotate90SourceProperties(srcImage, dstImage, n);
            this._markAsDirty();
        }
        else {
            srcImage.onSVGAttributesComputedObservable.addOnce(function () {
                _this._rotate90SourceProperties(srcImage, dstImage, n);
                _this._markAsDirty();
            });
        }
    };
    Image.prototype._rotate90SourceProperties = function (srcImage, dstImage, n) {
        var _a, _b;
        var srcLeft = srcImage.sourceLeft, srcTop = srcImage.sourceTop, srcWidth = srcImage.domImage.width, srcHeight = srcImage.domImage.height;
        var dstLeft = srcLeft, dstTop = srcTop, dstWidth = srcImage.sourceWidth, dstHeight = srcImage.sourceHeight;
        if (n != 0) {
            var mult = n < 0 ? -1 : 1;
            n = n % 4;
            for (var i = 0; i < Math.abs(n); ++i) {
                dstLeft = -(srcTop - srcHeight / 2) * mult + srcHeight / 2;
                dstTop = (srcLeft - srcWidth / 2) * mult + srcWidth / 2;
                _a = [dstHeight, dstWidth], dstWidth = _a[0], dstHeight = _a[1];
                if (n < 0) {
                    dstTop -= dstHeight;
                }
                else {
                    dstLeft -= dstWidth;
                }
                srcLeft = dstLeft;
                srcTop = dstTop;
                _b = [srcHeight, srcWidth], srcWidth = _b[0], srcHeight = _b[1];
            }
        }
        dstImage.sourceLeft = dstLeft;
        dstImage.sourceTop = dstTop;
        dstImage.sourceWidth = dstWidth;
        dstImage.sourceHeight = dstHeight;
    };
    Image.prototype._extractNinePatchSliceDataFromImage = function () {
        var _a, _b;
        var width = this._domImage.width;
        var height = this._domImage.height;
        if (!this._workingCanvas) {
            var engine = ((_b = (_a = this._host) === null || _a === void 0 ? void 0 : _a.getScene()) === null || _b === void 0 ? void 0 : _b.getEngine()) || core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.EngineStore.LastCreatedEngine;
            if (!engine) {
                throw new Error("Invalid engine. Unable to create a canvas.");
            }
            this._workingCanvas = engine.createCanvas(width, height);
        }
        var canvas = this._workingCanvas;
        var context = canvas.getContext("2d");
        context.drawImage(this._domImage, 0, 0, width, height);
        var imageData = context.getImageData(0, 0, width, height);
        // Left and right
        this._sliceLeft = -1;
        this._sliceRight = -1;
        for (var x = 0; x < width; x++) {
            var alpha = imageData.data[x * 4 + 3];
            if (alpha > 127 && this._sliceLeft === -1) {
                this._sliceLeft = x;
                continue;
            }
            if (alpha < 127 && this._sliceLeft > -1) {
                this._sliceRight = x;
                break;
            }
        }
        // top and bottom
        this._sliceTop = -1;
        this._sliceBottom = -1;
        for (var y = 0; y < height; y++) {
            var alpha = imageData.data[y * width * 4 + 3];
            if (alpha > 127 && this._sliceTop === -1) {
                this._sliceTop = y;
                continue;
            }
            if (alpha < 127 && this._sliceTop > -1) {
                this._sliceBottom = y;
                break;
            }
        }
    };
    Object.defineProperty(Image.prototype, "domImage", {
        get: function () {
            return this._domImage;
        },
        /**
         * Gets or sets the internal DOM image used to render the control
         */
        set: function (value) {
            var _this = this;
            this._domImage = value;
            this._loaded = false;
            this._imageDataCache.data = null;
            if (this._domImage.width) {
                this._onImageLoaded();
            }
            else {
                this._domImage.onload = function () {
                    _this._onImageLoaded();
                };
            }
        },
        enumerable: false,
        configurable: true
    });
    Image.prototype._onImageLoaded = function () {
        this._imageDataCache.data = null;
        this._imageWidth = this._domImage.width;
        this._imageHeight = this._domImage.height;
        this._loaded = true;
        if (this._populateNinePatchSlicesFromImage) {
            this._extractNinePatchSliceDataFromImage();
        }
        if (this._autoScale) {
            this.synchronizeSizeWithContent();
        }
        this.onImageLoadedObservable.notifyObservers(this);
        this._markAsDirty();
    };
    Object.defineProperty(Image.prototype, "source", {
        /**
         * Gets the image source url
         */
        get: function () {
            return this._source;
        },
        /**
         * Gets or sets image source url
         */
        set: function (value) {
            var _this = this;
            var _a, _b;
            if (this._source === value) {
                return;
            }
            this._loaded = false;
            this._source = value;
            this._imageDataCache.data = null;
            if (value) {
                value = this._svgCheck(value);
            }
            // Should abstract platform instead of using LastCreatedEngine
            var engine = ((_b = (_a = this._host) === null || _a === void 0 ? void 0 : _a.getScene()) === null || _b === void 0 ? void 0 : _b.getEngine()) || core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.EngineStore.LastCreatedEngine;
            if (!engine) {
                throw new Error("Invalid engine. Unable to create a canvas.");
            }
            this._domImage = engine.createCanvasImage();
            this._domImage.onload = function () {
                _this._onImageLoaded();
            };
            if (value) {
                core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Tools.SetCorsBehavior(value, this._domImage);
                this._domImage.src = value;
            }
        },
        enumerable: false,
        configurable: true
    });
    /**
     * Checks for svg document with icon id present
     * @param value
     */
    Image.prototype._svgCheck = function (value) {
        var _this = this;
        if (window.SVGSVGElement && value.search(/.svg#/gi) !== -1 && value.indexOf("#") === value.lastIndexOf("#")) {
            this._isSVG = true;
            var svgsrc_1 = value.split("#")[0];
            var elemid_1 = value.split("#")[1];
            // check if object alr exist in document
            var svgExist_1 = document.body.querySelector('object[data="' + svgsrc_1 + '"]');
            if (svgExist_1) {
                var svgDoc = svgExist_1.contentDocument;
                // get viewbox width and height, get svg document width and height in px
                if (svgDoc && svgDoc.documentElement) {
                    var vb = svgDoc.documentElement.getAttribute("viewBox");
                    var docwidth = Number(svgDoc.documentElement.getAttribute("width"));
                    var docheight = Number(svgDoc.documentElement.getAttribute("height"));
                    var elem = svgDoc.getElementById(elemid_1);
                    if (elem && vb && docwidth && docheight) {
                        this._getSVGAttribs(svgExist_1, elemid_1);
                        return value;
                    }
                }
                // wait for object to load
                svgExist_1.addEventListener("load", function () {
                    _this._getSVGAttribs(svgExist_1, elemid_1);
                });
            }
            else {
                // create document object
                var svgImage = document.createElement("object");
                svgImage.data = svgsrc_1;
                svgImage.type = "image/svg+xml";
                svgImage.width = "0%";
                svgImage.height = "0%";
                document.body.appendChild(svgImage);
                // when the object has loaded, get the element attribs
                svgImage.onload = function () {
                    var svgobj = document.body.querySelector('object[data="' + svgsrc_1 + '"]');
                    if (svgobj) {
                        _this._getSVGAttribs(svgobj, elemid_1);
                    }
                };
            }
            return svgsrc_1;
        }
        else {
            return value;
        }
    };
    /**
     * Sets sourceLeft, sourceTop, sourceWidth, sourceHeight automatically
     * given external svg file and icon id
     * @param svgsrc
     * @param elemid
     */
    Image.prototype._getSVGAttribs = function (svgsrc, elemid) {
        var svgDoc = svgsrc.contentDocument;
        // get viewbox width and height, get svg document width and height in px
        if (svgDoc && svgDoc.documentElement) {
            var vb = svgDoc.documentElement.getAttribute("viewBox");
            var docwidth = Number(svgDoc.documentElement.getAttribute("width"));
            var docheight = Number(svgDoc.documentElement.getAttribute("height"));
            // get element bbox and matrix transform
            var elem = svgDoc.getElementById(elemid);
            if (vb && docwidth && docheight && elem) {
                var vb_width = Number(vb.split(" ")[2]);
                var vb_height = Number(vb.split(" ")[3]);
                var elem_bbox = elem.getBBox();
                var elem_matrix_a = 1;
                var elem_matrix_d = 1;
                var elem_matrix_e = 0;
                var elem_matrix_f = 0;
                var mainMatrix = elem.transform.baseVal.consolidate().matrix;
                if (elem.transform && elem.transform.baseVal.consolidate()) {
                    elem_matrix_a = mainMatrix.a;
                    elem_matrix_d = mainMatrix.d;
                    elem_matrix_e = mainMatrix.e;
                    elem_matrix_f = mainMatrix.f;
                }
                // compute source coordinates and dimensions
                this.sourceLeft = ((elem_matrix_a * elem_bbox.x + elem_matrix_e) * docwidth) / vb_width;
                this.sourceTop = ((elem_matrix_d * elem_bbox.y + elem_matrix_f) * docheight) / vb_height;
                this.sourceWidth = elem_bbox.width * elem_matrix_a * (docwidth / vb_width);
                this.sourceHeight = elem_bbox.height * elem_matrix_d * (docheight / vb_height);
                this._svgAttributesComputationCompleted = true;
                this.onSVGAttributesComputedObservable.notifyObservers(this);
            }
        }
    };
    Object.defineProperty(Image.prototype, "cellWidth", {
        /**
         * Gets or sets the cell width to use when animation sheet is enabled
         * @see https://doc.babylonjs.com/how_to/gui#image
         */
        get: function () {
            return this._cellWidth;
        },
        set: function (value) {
            if (this._cellWidth === value) {
                return;
            }
            this._cellWidth = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Image.prototype, "cellHeight", {
        /**
         * Gets or sets the cell height to use when animation sheet is enabled
         * @see https://doc.babylonjs.com/how_to/gui#image
         */
        get: function () {
            return this._cellHeight;
        },
        set: function (value) {
            if (this._cellHeight === value) {
                return;
            }
            this._cellHeight = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Image.prototype, "cellId", {
        /**
         * Gets or sets the cell id to use (this will turn on the animation sheet mode)
         * @see https://doc.babylonjs.com/how_to/gui#image
         */
        get: function () {
            return this._cellId;
        },
        set: function (value) {
            if (this._cellId === value) {
                return;
            }
            this._cellId = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    /**
     * Tests if a given coordinates belong to the current control
     * @param x defines x coordinate to test
     * @param y defines y coordinate to test
     * @returns true if the coordinates are inside the control
     */
    Image.prototype.contains = function (x, y) {
        if (!_super.prototype.contains.call(this, x, y)) {
            return false;
        }
        if (!this._detectPointerOnOpaqueOnly || !this._workingCanvas) {
            return true;
        }
        var width = this._currentMeasure.width | 0;
        var height = this._currentMeasure.height | 0;
        var key = width + "_" + height;
        var imageData = this._imageDataCache.data;
        if (!imageData || this._imageDataCache.key !== key) {
            var canvas = this._workingCanvas;
            var context_1 = canvas.getContext("2d");
            this._imageDataCache.data = imageData = context_1.getImageData(0, 0, width, height).data;
            this._imageDataCache.key = key;
        }
        x = (x - this._currentMeasure.left) | 0;
        y = (y - this._currentMeasure.top) | 0;
        var pickedPixel = imageData[(x + y * width) * 4 + 3];
        return pickedPixel > 0;
    };
    Image.prototype._getTypeName = function () {
        return "Image";
    };
    /** Force the control to synchronize with its content */
    Image.prototype.synchronizeSizeWithContent = function () {
        if (!this._loaded) {
            return;
        }
        this.width = this._domImage.width + "px";
        this.height = this._domImage.height + "px";
    };
    Image.prototype._processMeasures = function (parentMeasure, context) {
        if (this._loaded) {
            switch (this._stretch) {
                case Image.STRETCH_NONE:
                    break;
                case Image.STRETCH_FILL:
                    break;
                case Image.STRETCH_UNIFORM:
                    break;
                case Image.STRETCH_NINE_PATCH:
                    break;
                case Image.STRETCH_EXTEND:
                    if (this._autoScale) {
                        this.synchronizeSizeWithContent();
                    }
                    if (this.parent && this.parent.parent) {
                        // Will update root size if root is not the top root
                        this.parent.adaptWidthToChildren = true;
                        this.parent.adaptHeightToChildren = true;
                    }
                    break;
            }
        }
        _super.prototype._processMeasures.call(this, parentMeasure, context);
    };
    Image.prototype._prepareWorkingCanvasForOpaqueDetection = function () {
        var _a, _b;
        if (!this._detectPointerOnOpaqueOnly) {
            return;
        }
        var width = this._currentMeasure.width;
        var height = this._currentMeasure.height;
        if (!this._workingCanvas) {
            var engine = ((_b = (_a = this._host) === null || _a === void 0 ? void 0 : _a.getScene()) === null || _b === void 0 ? void 0 : _b.getEngine()) || core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.EngineStore.LastCreatedEngine;
            if (!engine) {
                throw new Error("Invalid engine. Unable to create a canvas.");
            }
            this._workingCanvas = engine.createCanvas(width, height);
        }
        var canvas = this._workingCanvas;
        var context = canvas.getContext("2d");
        context.clearRect(0, 0, width, height);
    };
    Image.prototype._drawImage = function (context, sx, sy, sw, sh, tx, ty, tw, th) {
        context.drawImage(this._domImage, sx, sy, sw, sh, tx, ty, tw, th);
        if (!this._detectPointerOnOpaqueOnly) {
            return;
        }
        var canvas = this._workingCanvas;
        context = canvas.getContext("2d");
        context.drawImage(this._domImage, sx, sy, sw, sh, tx - this._currentMeasure.left, ty - this._currentMeasure.top, tw, th);
    };
    Image.prototype._draw = function (context) {
        context.save();
        if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
            context.shadowColor = this.shadowColor;
            context.shadowBlur = this.shadowBlur;
            context.shadowOffsetX = this.shadowOffsetX;
            context.shadowOffsetY = this.shadowOffsetY;
        }
        var x, y, width, height;
        if (this.cellId == -1) {
            x = this._sourceLeft;
            y = this._sourceTop;
            width = this._sourceWidth ? this._sourceWidth : this._imageWidth;
            height = this._sourceHeight ? this._sourceHeight : this._imageHeight;
        }
        else {
            var rowCount = this._domImage.naturalWidth / this.cellWidth;
            var column = (this.cellId / rowCount) >> 0;
            var row = this.cellId % rowCount;
            x = this.cellWidth * row;
            y = this.cellHeight * column;
            width = this.cellWidth;
            height = this.cellHeight;
        }
        this._prepareWorkingCanvasForOpaqueDetection();
        this._applyStates(context);
        if (this._loaded) {
            switch (this._stretch) {
                case Image.STRETCH_NONE:
                    this._drawImage(context, x, y, width, height, this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);
                    break;
                case Image.STRETCH_FILL:
                    this._drawImage(context, x, y, width, height, this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);
                    break;
                case Image.STRETCH_UNIFORM: {
                    var hRatio = this._currentMeasure.width / width;
                    var vRatio = this._currentMeasure.height / height;
                    var ratio = Math.min(hRatio, vRatio);
                    var centerX = (this._currentMeasure.width - width * ratio) / 2;
                    var centerY = (this._currentMeasure.height - height * ratio) / 2;
                    this._drawImage(context, x, y, width, height, this._currentMeasure.left + centerX, this._currentMeasure.top + centerY, width * ratio, height * ratio);
                    break;
                }
                case Image.STRETCH_EXTEND:
                    this._drawImage(context, x, y, width, height, this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);
                    break;
                case Image.STRETCH_NINE_PATCH:
                    this._renderNinePatch(context);
                    break;
            }
        }
        context.restore();
    };
    Image.prototype._renderNinePatch = function (context) {
        var leftWidth = this._sliceLeft;
        var topHeight = this._sliceTop;
        var bottomHeight = this._imageHeight - this._sliceBottom;
        var rightWidth = this._imageWidth - this._sliceRight;
        var centerWidth = this._sliceRight - this._sliceLeft;
        var centerHeight = this._sliceBottom - this._sliceTop;
        var targetCenterWidth = this._currentMeasure.width - rightWidth - leftWidth + 2;
        var targetCenterHeight = this._currentMeasure.height - bottomHeight - topHeight + 2;
        var centerLeftOffset = this._currentMeasure.left + leftWidth - 1;
        var centerTopOffset = this._currentMeasure.top + topHeight - 1;
        var rightOffset = this._currentMeasure.left + this._currentMeasure.width - rightWidth;
        var bottomOffset = this._currentMeasure.top + this._currentMeasure.height - bottomHeight;
        //Top Left
        this._drawImage(context, 0, 0, leftWidth, topHeight, this._currentMeasure.left, this._currentMeasure.top, leftWidth, topHeight);
        //Top
        context.clearRect(centerLeftOffset, this._currentMeasure.top, targetCenterWidth, topHeight);
        this._drawImage(context, this._sliceLeft, 0, centerWidth, topHeight, centerLeftOffset, this._currentMeasure.top, targetCenterWidth, topHeight);
        //Top Right
        context.clearRect(rightOffset, this._currentMeasure.top, rightWidth, topHeight);
        this._drawImage(context, this._sliceRight, 0, rightWidth, topHeight, rightOffset, this._currentMeasure.top, rightWidth, topHeight);
        //Left
        context.clearRect(this._currentMeasure.left, centerTopOffset, leftWidth, targetCenterHeight);
        this._drawImage(context, 0, this._sliceTop, leftWidth, centerHeight, this._currentMeasure.left, centerTopOffset, leftWidth, targetCenterHeight);
        // Center
        context.clearRect(centerLeftOffset, centerTopOffset, targetCenterWidth, targetCenterHeight);
        this._drawImage(context, this._sliceLeft, this._sliceTop, centerWidth, centerHeight, centerLeftOffset, centerTopOffset, targetCenterWidth, targetCenterHeight);
        //Right
        context.clearRect(rightOffset, centerTopOffset, rightWidth, targetCenterHeight);
        this._drawImage(context, this._sliceRight, this._sliceTop, rightWidth, centerHeight, rightOffset, centerTopOffset, rightWidth, targetCenterHeight);
        //Bottom Left
        context.clearRect(this._currentMeasure.left, bottomOffset, leftWidth, bottomHeight);
        this._drawImage(context, 0, this._sliceBottom, leftWidth, bottomHeight, this._currentMeasure.left, bottomOffset, leftWidth, bottomHeight);
        //Bottom
        context.clearRect(centerLeftOffset, bottomOffset, targetCenterWidth, bottomHeight);
        this._drawImage(context, this.sliceLeft, this._sliceBottom, centerWidth, bottomHeight, centerLeftOffset, bottomOffset, targetCenterWidth, bottomHeight);
        //Bottom Right
        context.clearRect(rightOffset, bottomOffset, rightWidth, bottomHeight);
        this._drawImage(context, this._sliceRight, this._sliceBottom, rightWidth, bottomHeight, rightOffset, bottomOffset, rightWidth, bottomHeight);
    };
    Image.prototype.dispose = function () {
        _super.prototype.dispose.call(this);
        this.onImageLoadedObservable.clear();
        this.onSVGAttributesComputedObservable.clear();
    };
    // Static
    /** STRETCH_NONE */
    Image.STRETCH_NONE = 0;
    /** STRETCH_FILL */
    Image.STRETCH_FILL = 1;
    /** STRETCH_UNIFORM */
    Image.STRETCH_UNIFORM = 2;
    /** STRETCH_EXTEND */
    Image.STRETCH_EXTEND = 3;
    /** NINE_PATCH */
    Image.STRETCH_NINE_PATCH = 4;
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Image.prototype, "detectPointerOnOpaqueOnly", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Image.prototype, "sliceLeft", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Image.prototype, "sliceRight", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Image.prototype, "sliceTop", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Image.prototype, "sliceBottom", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Image.prototype, "sourceLeft", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Image.prototype, "sourceTop", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Image.prototype, "sourceWidth", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Image.prototype, "sourceHeight", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Image.prototype, "populateNinePatchSlicesFromImage", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Image.prototype, "autoScale", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Image.prototype, "stretch", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Image.prototype, "source", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Image.prototype, "cellWidth", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Image.prototype, "cellHeight", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Image.prototype, "cellId", null);
    return Image;
}(_control__WEBPACK_IMPORTED_MODULE_2__.Control));

(0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.RegisterClass)("BABYLON.GUI.Image", Image);


/***/ }),

/***/ "../../../lts/gui/dist/2D/controls/index.js":
/*!**************************************************!*\
  !*** ../../../lts/gui/dist/2D/controls/index.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "BaseSlider": () => (/* reexport safe */ _sliders_baseSlider__WEBPACK_IMPORTED_MODULE_24__.BaseSlider),
/* harmony export */   "Button": () => (/* reexport safe */ _button__WEBPACK_IMPORTED_MODULE_0__.Button),
/* harmony export */   "Checkbox": () => (/* reexport safe */ _checkbox__WEBPACK_IMPORTED_MODULE_1__.Checkbox),
/* harmony export */   "CheckboxGroup": () => (/* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_16__.CheckboxGroup),
/* harmony export */   "ColorPicker": () => (/* reexport safe */ _colorpicker__WEBPACK_IMPORTED_MODULE_2__.ColorPicker),
/* harmony export */   "Container": () => (/* reexport safe */ _container__WEBPACK_IMPORTED_MODULE_3__.Container),
/* harmony export */   "Control": () => (/* reexport safe */ _control__WEBPACK_IMPORTED_MODULE_4__.Control),
/* harmony export */   "DisplayGrid": () => (/* reexport safe */ _displayGrid__WEBPACK_IMPORTED_MODULE_23__.DisplayGrid),
/* harmony export */   "Ellipse": () => (/* reexport safe */ _ellipse__WEBPACK_IMPORTED_MODULE_5__.Ellipse),
/* harmony export */   "FocusableButton": () => (/* reexport safe */ _focusableButton__WEBPACK_IMPORTED_MODULE_6__.FocusableButton),
/* harmony export */   "Grid": () => (/* reexport safe */ _grid__WEBPACK_IMPORTED_MODULE_8__.Grid),
/* harmony export */   "Image": () => (/* reexport safe */ _image__WEBPACK_IMPORTED_MODULE_9__.Image),
/* harmony export */   "ImageBasedSlider": () => (/* reexport safe */ _sliders_imageBasedSlider__WEBPACK_IMPORTED_MODULE_26__.ImageBasedSlider),
/* harmony export */   "ImageScrollBar": () => (/* reexport safe */ _sliders_imageScrollBar__WEBPACK_IMPORTED_MODULE_28__.ImageScrollBar),
/* harmony export */   "InputPassword": () => (/* reexport safe */ _inputPassword__WEBPACK_IMPORTED_MODULE_11__.InputPassword),
/* harmony export */   "InputText": () => (/* reexport safe */ _inputText__WEBPACK_IMPORTED_MODULE_10__.InputText),
/* harmony export */   "KeyPropertySet": () => (/* reexport safe */ _virtualKeyboard__WEBPACK_IMPORTED_MODULE_21__.KeyPropertySet),
/* harmony export */   "Line": () => (/* reexport safe */ _line__WEBPACK_IMPORTED_MODULE_12__.Line),
/* harmony export */   "MultiLine": () => (/* reexport safe */ _multiLine__WEBPACK_IMPORTED_MODULE_13__.MultiLine),
/* harmony export */   "RadioButton": () => (/* reexport safe */ _radioButton__WEBPACK_IMPORTED_MODULE_14__.RadioButton),
/* harmony export */   "RadioGroup": () => (/* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_16__.RadioGroup),
/* harmony export */   "Rectangle": () => (/* reexport safe */ _rectangle__WEBPACK_IMPORTED_MODULE_22__.Rectangle),
/* harmony export */   "ScrollBar": () => (/* reexport safe */ _sliders_scrollBar__WEBPACK_IMPORTED_MODULE_27__.ScrollBar),
/* harmony export */   "ScrollViewer": () => (/* reexport safe */ _scrollViewers_scrollViewer__WEBPACK_IMPORTED_MODULE_17__.ScrollViewer),
/* harmony export */   "SelectionPanel": () => (/* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_16__.SelectionPanel),
/* harmony export */   "SelectorGroup": () => (/* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_16__.SelectorGroup),
/* harmony export */   "Slider": () => (/* reexport safe */ _sliders_slider__WEBPACK_IMPORTED_MODULE_25__.Slider),
/* harmony export */   "SliderGroup": () => (/* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_16__.SliderGroup),
/* harmony export */   "StackPanel": () => (/* reexport safe */ _stackPanel__WEBPACK_IMPORTED_MODULE_15__.StackPanel),
/* harmony export */   "TextBlock": () => (/* reexport safe */ _textBlock__WEBPACK_IMPORTED_MODULE_18__.TextBlock),
/* harmony export */   "TextWrapper": () => (/* reexport safe */ _textWrapper__WEBPACK_IMPORTED_MODULE_19__.TextWrapper),
/* harmony export */   "TextWrapping": () => (/* reexport safe */ _textBlock__WEBPACK_IMPORTED_MODULE_18__.TextWrapping),
/* harmony export */   "ToggleButton": () => (/* reexport safe */ _toggleButton__WEBPACK_IMPORTED_MODULE_20__.ToggleButton),
/* harmony export */   "VirtualKeyboard": () => (/* reexport safe */ _virtualKeyboard__WEBPACK_IMPORTED_MODULE_21__.VirtualKeyboard),
/* harmony export */   "name": () => (/* reexport safe */ _statics__WEBPACK_IMPORTED_MODULE_29__.name)
/* harmony export */ });
/* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./button */ "../../../lts/gui/dist/2D/controls/button.js");
/* harmony import */ var _checkbox__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./checkbox */ "../../../lts/gui/dist/2D/controls/checkbox.js");
/* harmony import */ var _colorpicker__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./colorpicker */ "../../../lts/gui/dist/2D/controls/colorpicker.js");
/* harmony import */ var _container__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./container */ "../../../lts/gui/dist/2D/controls/container.js");
/* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./control */ "../../../lts/gui/dist/2D/controls/control.js");
/* harmony import */ var _ellipse__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ellipse */ "../../../lts/gui/dist/2D/controls/ellipse.js");
/* harmony import */ var _focusableButton__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./focusableButton */ "../../../lts/gui/dist/2D/controls/focusableButton.js");
/* harmony import */ var _focusableControl__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./focusableControl */ "../../../lts/gui/dist/2D/controls/focusableControl.js");
/* harmony import */ var _grid__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./grid */ "../../../lts/gui/dist/2D/controls/grid.js");
/* harmony import */ var _image__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./image */ "../../../lts/gui/dist/2D/controls/image.js");
/* harmony import */ var _inputText__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./inputText */ "../../../lts/gui/dist/2D/controls/inputText.js");
/* harmony import */ var _inputPassword__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./inputPassword */ "../../../lts/gui/dist/2D/controls/inputPassword.js");
/* harmony import */ var _line__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./line */ "../../../lts/gui/dist/2D/controls/line.js");
/* harmony import */ var _multiLine__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./multiLine */ "../../../lts/gui/dist/2D/controls/multiLine.js");
/* harmony import */ var _radioButton__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./radioButton */ "../../../lts/gui/dist/2D/controls/radioButton.js");
/* harmony import */ var _stackPanel__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./stackPanel */ "../../../lts/gui/dist/2D/controls/stackPanel.js");
/* harmony import */ var _selector__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./selector */ "../../../lts/gui/dist/2D/controls/selector.js");
/* harmony import */ var _scrollViewers_scrollViewer__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./scrollViewers/scrollViewer */ "../../../lts/gui/dist/2D/controls/scrollViewers/scrollViewer.js");
/* harmony import */ var _textBlock__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./textBlock */ "../../../lts/gui/dist/2D/controls/textBlock.js");
/* harmony import */ var _textWrapper__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./textWrapper */ "../../../lts/gui/dist/2D/controls/textWrapper.js");
/* harmony import */ var _toggleButton__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./toggleButton */ "../../../lts/gui/dist/2D/controls/toggleButton.js");
/* harmony import */ var _virtualKeyboard__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./virtualKeyboard */ "../../../lts/gui/dist/2D/controls/virtualKeyboard.js");
/* harmony import */ var _rectangle__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./rectangle */ "../../../lts/gui/dist/2D/controls/rectangle.js");
/* harmony import */ var _displayGrid__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./displayGrid */ "../../../lts/gui/dist/2D/controls/displayGrid.js");
/* harmony import */ var _sliders_baseSlider__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./sliders/baseSlider */ "../../../lts/gui/dist/2D/controls/sliders/baseSlider.js");
/* harmony import */ var _sliders_slider__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./sliders/slider */ "../../../lts/gui/dist/2D/controls/sliders/slider.js");
/* harmony import */ var _sliders_imageBasedSlider__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./sliders/imageBasedSlider */ "../../../lts/gui/dist/2D/controls/sliders/imageBasedSlider.js");
/* harmony import */ var _sliders_scrollBar__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./sliders/scrollBar */ "../../../lts/gui/dist/2D/controls/sliders/scrollBar.js");
/* harmony import */ var _sliders_imageScrollBar__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./sliders/imageScrollBar */ "../../../lts/gui/dist/2D/controls/sliders/imageScrollBar.js");
/* harmony import */ var _statics__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./statics */ "../../../lts/gui/dist/2D/controls/statics.js");
































/***/ }),

/***/ "../../../lts/gui/dist/2D/controls/inputPassword.js":
/*!**********************************************************!*\
  !*** ../../../lts/gui/dist/2D/controls/inputPassword.js ***!
  \**********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "InputPassword": () => (/* binding */ InputPassword)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var _inputText__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./inputText */ "../../../lts/gui/dist/2D/controls/inputText.js");
/* harmony import */ var core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core/Misc/typeStore */ "core/Misc/observable");
/* harmony import */ var core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _textWrapper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./textWrapper */ "../../../lts/gui/dist/2D/controls/textWrapper.js");




/**
 * Class used to create a password control
 */
var InputPassword = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(InputPassword, _super);
    function InputPassword() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    InputPassword.prototype._getTypeName = function () {
        return "InputPassword";
    };
    InputPassword.prototype._beforeRenderText = function (textWrapper) {
        var pwdTextWrapper = new _textWrapper__WEBPACK_IMPORTED_MODULE_3__.TextWrapper();
        var txt = "";
        for (var i = 0; i < textWrapper.length; i++) {
            txt += "\u2022";
        }
        pwdTextWrapper.text = txt;
        return pwdTextWrapper;
    };
    return InputPassword;
}(_inputText__WEBPACK_IMPORTED_MODULE_1__.InputText));

(0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2__.RegisterClass)("BABYLON.GUI.InputPassword", InputPassword);


/***/ }),

/***/ "../../../lts/gui/dist/2D/controls/inputText.js":
/*!******************************************************!*\
  !*** ../../../lts/gui/dist/2D/controls/inputText.js ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "InputText": () => (/* binding */ InputText)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Misc/decorators */ "core/Misc/observable");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./control */ "../../../lts/gui/dist/2D/controls/control.js");
/* harmony import */ var _valueAndUnit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../valueAndUnit */ "../../../lts/gui/dist/2D/valueAndUnit.js");
/* harmony import */ var _textWrapper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./textWrapper */ "../../../lts/gui/dist/2D/controls/textWrapper.js");









/**
 * Class used to create input text control
 */
var InputText = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(InputText, _super);
    /**
     * Creates a new InputText
     * @param name defines the control name
     * @param text defines the text of the control
     */
    function InputText(name, text) {
        if (text === void 0) { text = ""; }
        var _this = _super.call(this, name) || this;
        _this.name = name;
        _this._placeholderText = "";
        _this._background = "#222222";
        _this._focusedBackground = "#000000";
        _this._focusedColor = "white";
        _this._placeholderColor = "gray";
        _this._thickness = 1;
        _this._margin = new _valueAndUnit__WEBPACK_IMPORTED_MODULE_3__.ValueAndUnit(10, _valueAndUnit__WEBPACK_IMPORTED_MODULE_3__.ValueAndUnit.UNITMODE_PIXEL);
        _this._autoStretchWidth = true;
        _this._maxWidth = new _valueAndUnit__WEBPACK_IMPORTED_MODULE_3__.ValueAndUnit(1, _valueAndUnit__WEBPACK_IMPORTED_MODULE_3__.ValueAndUnit.UNITMODE_PERCENTAGE, false);
        _this._isFocused = false;
        _this._blinkIsEven = false;
        _this._cursorOffset = 0;
        _this._deadKey = false;
        _this._addKey = true;
        _this._currentKey = "";
        _this._isTextHighlightOn = false;
        _this._textHighlightColor = "#d5e0ff";
        _this._highligherOpacity = 0.4;
        _this._highlightedText = "";
        _this._startHighlightIndex = 0;
        _this._endHighlightIndex = 0;
        _this._cursorIndex = -1;
        _this._onFocusSelectAll = false;
        _this._isPointerDown = false;
        /** Gets or sets a string representing the message displayed on mobile when the control gets the focus */
        _this.promptMessage = "Please enter text:";
        /** Force disable prompt on mobile device */
        _this.disableMobilePrompt = false;
        /** Observable raised when the text changes */
        _this.onTextChangedObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        /** Observable raised just before an entered character is to be added */
        _this.onBeforeKeyAddObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        /** Observable raised when the control gets the focus */
        _this.onFocusObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        /** Observable raised when the control loses the focus */
        _this.onBlurObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        /**Observable raised when the text is highlighted */
        _this.onTextHighlightObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        /**Observable raised when copy event is triggered */
        _this.onTextCopyObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        /** Observable raised when cut event is triggered */
        _this.onTextCutObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        /** Observable raised when paste event is triggered */
        _this.onTextPasteObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        /** Observable raised when a key event was processed */
        _this.onKeyboardEventProcessedObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        _this.text = text;
        _this.isPointerBlocker = true;
        return _this;
    }
    Object.defineProperty(InputText.prototype, "maxWidth", {
        /** Gets or sets the maximum width allowed by the control */
        get: function () {
            return this._maxWidth.toString(this._host);
        },
        set: function (value) {
            if (this._maxWidth.toString(this._host) === value) {
                return;
            }
            if (this._maxWidth.fromString(value)) {
                this._markAsDirty();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(InputText.prototype, "maxWidthInPixels", {
        /** Gets the maximum width allowed by the control in pixels */
        get: function () {
            return this._maxWidth.getValueInPixel(this._host, this._cachedParentMeasure.width);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(InputText.prototype, "highligherOpacity", {
        /** Gets or sets the text highlighter transparency; default: 0.4 */
        get: function () {
            return this._highligherOpacity;
        },
        set: function (value) {
            if (this._highligherOpacity === value) {
                return;
            }
            this._highligherOpacity = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(InputText.prototype, "onFocusSelectAll", {
        /** Gets or sets a boolean indicating whether to select complete text by default on input focus */
        get: function () {
            return this._onFocusSelectAll;
        },
        set: function (value) {
            if (this._onFocusSelectAll === value) {
                return;
            }
            this._onFocusSelectAll = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(InputText.prototype, "textHighlightColor", {
        /** Gets or sets the text hightlight color */
        get: function () {
            return this._textHighlightColor;
        },
        set: function (value) {
            if (this._textHighlightColor === value) {
                return;
            }
            this._textHighlightColor = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(InputText.prototype, "margin", {
        /** Gets or sets control margin */
        get: function () {
            return this._margin.toString(this._host);
        },
        set: function (value) {
            if (this._margin.toString(this._host) === value) {
                return;
            }
            if (this._margin.fromString(value)) {
                this._markAsDirty();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(InputText.prototype, "marginInPixels", {
        /** Gets control margin in pixels */
        get: function () {
            return this._margin.getValueInPixel(this._host, this._cachedParentMeasure.width);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(InputText.prototype, "autoStretchWidth", {
        /** Gets or sets a boolean indicating if the control can auto stretch its width to adapt to the text */
        get: function () {
            return this._autoStretchWidth;
        },
        set: function (value) {
            if (this._autoStretchWidth === value) {
                return;
            }
            this._autoStretchWidth = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(InputText.prototype, "thickness", {
        /** Gets or sets border thickness */
        get: function () {
            return this._thickness;
        },
        set: function (value) {
            if (this._thickness === value) {
                return;
            }
            this._thickness = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(InputText.prototype, "focusedBackground", {
        /** Gets or sets the background color when focused */
        get: function () {
            return this._focusedBackground;
        },
        set: function (value) {
            if (this._focusedBackground === value) {
                return;
            }
            this._focusedBackground = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(InputText.prototype, "focusedColor", {
        /** Gets or sets the background color when focused */
        get: function () {
            return this._focusedColor;
        },
        set: function (value) {
            if (this._focusedColor === value) {
                return;
            }
            this._focusedColor = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(InputText.prototype, "background", {
        /** Gets or sets the background color */
        get: function () {
            return this._background;
        },
        set: function (value) {
            if (this._background === value) {
                return;
            }
            this._background = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(InputText.prototype, "placeholderColor", {
        /** Gets or sets the placeholder color */
        get: function () {
            return this._placeholderColor;
        },
        set: function (value) {
            if (this._placeholderColor === value) {
                return;
            }
            this._placeholderColor = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(InputText.prototype, "placeholderText", {
        /** Gets or sets the text displayed when the control is empty */
        get: function () {
            return this._placeholderText;
        },
        set: function (value) {
            if (this._placeholderText === value) {
                return;
            }
            this._placeholderText = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(InputText.prototype, "deadKey", {
        /** Gets or sets the dead key flag */
        get: function () {
            return this._deadKey;
        },
        set: function (flag) {
            this._deadKey = flag;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(InputText.prototype, "highlightedText", {
        /** Gets or sets the highlight text */
        get: function () {
            return this._highlightedText;
        },
        set: function (text) {
            if (this._highlightedText === text) {
                return;
            }
            this._highlightedText = text;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(InputText.prototype, "addKey", {
        /** Gets or sets if the current key should be added */
        get: function () {
            return this._addKey;
        },
        set: function (flag) {
            this._addKey = flag;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(InputText.prototype, "currentKey", {
        /** Gets or sets the value of the current key being entered */
        get: function () {
            return this._currentKey;
        },
        set: function (key) {
            this._currentKey = key;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(InputText.prototype, "text", {
        /** Gets or sets the text displayed in the control */
        get: function () {
            return this._textWrapper.text;
        },
        set: function (value) {
            var valueAsString = value.toString(); // Forcing convertion
            if (!this._textWrapper) {
                this._textWrapper = new _textWrapper__WEBPACK_IMPORTED_MODULE_4__.TextWrapper();
            }
            if (this._textWrapper.text === valueAsString) {
                return;
            }
            this._textWrapper.text = valueAsString;
            this._textHasChanged();
        },
        enumerable: false,
        configurable: true
    });
    InputText.prototype._textHasChanged = function () {
        this._markAsDirty();
        this.onTextChangedObservable.notifyObservers(this);
    };
    Object.defineProperty(InputText.prototype, "width", {
        /** Gets or sets control width */
        get: function () {
            return this._width.toString(this._host);
        },
        set: function (value) {
            if (this._width.toString(this._host) === value) {
                return;
            }
            if (this._width.fromString(value)) {
                this._markAsDirty();
            }
            this.autoStretchWidth = false;
        },
        enumerable: false,
        configurable: true
    });
    /** @hidden */
    InputText.prototype.onBlur = function () {
        this._isFocused = false;
        this._scrollLeft = null;
        this._cursorOffset = 0;
        clearTimeout(this._blinkTimeout);
        this._markAsDirty();
        this.onBlurObservable.notifyObservers(this);
        this._host.unRegisterClipboardEvents();
        if (this._onClipboardObserver) {
            this._host.onClipboardObservable.remove(this._onClipboardObserver);
        }
        var scene = this._host.getScene();
        if (this._onPointerDblTapObserver && scene) {
            scene.onPointerObservable.remove(this._onPointerDblTapObserver);
        }
    };
    /** @hidden */
    InputText.prototype.onFocus = function () {
        var _this = this;
        if (!this._isEnabled) {
            return;
        }
        this._scrollLeft = null;
        this._isFocused = true;
        this._blinkIsEven = false;
        this._cursorOffset = 0;
        this._markAsDirty();
        this.onFocusObservable.notifyObservers(this);
        if (this._focusedBy === "touch" && !this.disableMobilePrompt) {
            var value = prompt(this.promptMessage);
            if (value !== null) {
                this.text = value;
            }
            this._host.focusedControl = null;
            return;
        }
        this._host.registerClipboardEvents();
        this._onClipboardObserver = this._host.onClipboardObservable.add(function (clipboardInfo) {
            // process clipboard event, can be configured.
            switch (clipboardInfo.type) {
                case core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.ClipboardEventTypes.COPY:
                    _this._onCopyText(clipboardInfo.event);
                    _this.onTextCopyObservable.notifyObservers(_this);
                    break;
                case core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.ClipboardEventTypes.CUT:
                    _this._onCutText(clipboardInfo.event);
                    _this.onTextCutObservable.notifyObservers(_this);
                    break;
                case core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.ClipboardEventTypes.PASTE:
                    _this._onPasteText(clipboardInfo.event);
                    _this.onTextPasteObservable.notifyObservers(_this);
                    break;
                default:
                    return;
            }
        });
        var scene = this._host.getScene();
        if (scene) {
            //register the pointer double tap event
            this._onPointerDblTapObserver = scene.onPointerObservable.add(function (pointerInfo) {
                if (!_this._isFocused) {
                    return;
                }
                if (pointerInfo.type === core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PointerEventTypes.POINTERDOUBLETAP) {
                    _this._processDblClick(pointerInfo);
                }
            });
        }
        if (this._onFocusSelectAll) {
            this._selectAllText();
        }
    };
    /**
     * Function to focus an inputText programmatically
     */
    InputText.prototype.focus = function () {
        this._host.moveFocusToControl(this);
    };
    /**
     * Function to unfocus an inputText programmatically
     */
    InputText.prototype.blur = function () {
        this._host.focusedControl = null;
    };
    InputText.prototype._getTypeName = function () {
        return "InputText";
    };
    /**
     * Function called to get the list of controls that should not steal the focus from this control
     * @returns an array of controls
     */
    InputText.prototype.keepsFocusWith = function () {
        if (!this._connectedVirtualKeyboard) {
            return null;
        }
        return [this._connectedVirtualKeyboard];
    };
    /**
     * @param keyCode
     * @param key
     * @param evt
     * @hidden
     */
    InputText.prototype.processKey = function (keyCode, key, evt) {
        if (this.isReadOnly) {
            return;
        }
        //return if clipboard event keys (i.e -ctr/cmd + c,v,x)
        if (evt && (evt.ctrlKey || evt.metaKey) && (keyCode === 67 || keyCode === 86 || keyCode === 88)) {
            return;
        }
        //select all
        if (evt && (evt.ctrlKey || evt.metaKey) && keyCode === 65) {
            this._selectAllText();
            evt.preventDefault();
            return;
        }
        // Specific cases
        switch (keyCode) {
            case 32: //SPACE
                key = " "; //ie11 key for space is "Spacebar"
                break;
            case 191: //SLASH
                if (evt) {
                    evt.preventDefault();
                }
                break;
            case 8: // BACKSPACE
                if (this._textWrapper.text && this._textWrapper.length > 0) {
                    //delete the highlighted text
                    if (this._isTextHighlightOn) {
                        this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex);
                        this._textHasChanged();
                        this._isTextHighlightOn = false;
                        this._cursorOffset = this._textWrapper.length - this._startHighlightIndex;
                        this._blinkIsEven = false;
                        if (evt) {
                            evt.preventDefault();
                        }
                        return;
                    }
                    //delete single character
                    if (this._cursorOffset === 0) {
                        this.text = this._textWrapper.substr(0, this._textWrapper.length - 1);
                    }
                    else {
                        var deletePosition = this._textWrapper.length - this._cursorOffset;
                        if (deletePosition > 0) {
                            this._textWrapper.removePart(deletePosition - 1, deletePosition);
                            this._textHasChanged();
                        }
                    }
                }
                if (evt) {
                    evt.preventDefault();
                }
                return;
            case 46: // DELETE
                if (this._isTextHighlightOn) {
                    this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex);
                    this._textHasChanged();
                    this._isTextHighlightOn = false;
                    this._cursorOffset = this._textWrapper.length - this._startHighlightIndex;
                    if (evt) {
                        evt.preventDefault();
                    }
                    return;
                }
                if (this._textWrapper.text && this._textWrapper.length > 0 && this._cursorOffset > 0) {
                    var deletePosition = this._textWrapper.length - this._cursorOffset;
                    this._textWrapper.removePart(deletePosition, deletePosition + 1);
                    this._textHasChanged();
                    this._cursorOffset--;
                }
                if (evt) {
                    evt.preventDefault();
                }
                return;
            case 13: // RETURN
                this._host.focusedControl = null;
                this._isTextHighlightOn = false;
                return;
            case 35: // END
                this._cursorOffset = 0;
                this._blinkIsEven = false;
                this._isTextHighlightOn = false;
                this._markAsDirty();
                return;
            case 36: // HOME
                this._cursorOffset = this._textWrapper.length;
                this._blinkIsEven = false;
                this._isTextHighlightOn = false;
                this._markAsDirty();
                return;
            case 37: // LEFT
                this._cursorOffset++;
                if (this._cursorOffset > this._textWrapper.length) {
                    this._cursorOffset = this._textWrapper.length;
                }
                if (evt && evt.shiftKey) {
                    // update the cursor
                    this._blinkIsEven = false;
                    // shift + ctrl/cmd + <-
                    if (evt.ctrlKey || evt.metaKey) {
                        if (!this._isTextHighlightOn) {
                            if (this._textWrapper.length === this._cursorOffset) {
                                return;
                            }
                            else {
                                this._endHighlightIndex = this._textWrapper.length - this._cursorOffset + 1;
                            }
                        }
                        this._startHighlightIndex = 0;
                        this._cursorIndex = this._textWrapper.length - this._endHighlightIndex;
                        this._cursorOffset = this._textWrapper.length;
                        this._isTextHighlightOn = true;
                        this._markAsDirty();
                        return;
                    }
                    //store the starting point
                    if (!this._isTextHighlightOn) {
                        this._isTextHighlightOn = true;
                        this._cursorIndex = this._cursorOffset >= this._textWrapper.length ? this._textWrapper.length : this._cursorOffset - 1;
                    }
                    //if text is already highlighted
                    else if (this._cursorIndex === -1) {
                        this._cursorIndex = this._textWrapper.length - this._endHighlightIndex;
                        this._cursorOffset = this._startHighlightIndex === 0 ? this._textWrapper.length : this._textWrapper.length - this._startHighlightIndex + 1;
                    }
                    //set the highlight indexes
                    if (this._cursorIndex < this._cursorOffset) {
                        this._endHighlightIndex = this._textWrapper.length - this._cursorIndex;
                        this._startHighlightIndex = this._textWrapper.length - this._cursorOffset;
                    }
                    else if (this._cursorIndex > this._cursorOffset) {
                        this._endHighlightIndex = this._textWrapper.length - this._cursorOffset;
                        this._startHighlightIndex = this._textWrapper.length - this._cursorIndex;
                    }
                    else {
                        this._isTextHighlightOn = false;
                    }
                    this._markAsDirty();
                    return;
                }
                if (this._isTextHighlightOn) {
                    this._cursorOffset = this._textWrapper.length - this._startHighlightIndex;
                    this._isTextHighlightOn = false;
                }
                if (evt && (evt.ctrlKey || evt.metaKey)) {
                    this._cursorOffset = this._textWrapper.length;
                    evt.preventDefault();
                }
                this._blinkIsEven = false;
                this._isTextHighlightOn = false;
                this._cursorIndex = -1;
                this._markAsDirty();
                return;
            case 39: // RIGHT
                this._cursorOffset--;
                if (this._cursorOffset < 0) {
                    this._cursorOffset = 0;
                }
                if (evt && evt.shiftKey) {
                    //update the cursor
                    this._blinkIsEven = false;
                    //shift + ctrl/cmd + ->
                    if (evt.ctrlKey || evt.metaKey) {
                        if (!this._isTextHighlightOn) {
                            if (this._cursorOffset === 0) {
                                return;
                            }
                            else {
                                this._startHighlightIndex = this._textWrapper.length - this._cursorOffset - 1;
                            }
                        }
                        this._endHighlightIndex = this._textWrapper.length;
                        this._isTextHighlightOn = true;
                        this._cursorIndex = this._textWrapper.length - this._startHighlightIndex;
                        this._cursorOffset = 0;
                        this._markAsDirty();
                        return;
                    }
                    if (!this._isTextHighlightOn) {
                        this._isTextHighlightOn = true;
                        this._cursorIndex = this._cursorOffset <= 0 ? 0 : this._cursorOffset + 1;
                    }
                    //if text is already highlighted
                    else if (this._cursorIndex === -1) {
                        this._cursorIndex = this._textWrapper.length - this._startHighlightIndex;
                        this._cursorOffset = this._textWrapper.length === this._endHighlightIndex ? 0 : this._textWrapper.length - this._endHighlightIndex - 1;
                    }
                    //set the highlight indexes
                    if (this._cursorIndex < this._cursorOffset) {
                        this._endHighlightIndex = this._textWrapper.length - this._cursorIndex;
                        this._startHighlightIndex = this._textWrapper.length - this._cursorOffset;
                    }
                    else if (this._cursorIndex > this._cursorOffset) {
                        this._endHighlightIndex = this._textWrapper.length - this._cursorOffset;
                        this._startHighlightIndex = this._textWrapper.length - this._cursorIndex;
                    }
                    else {
                        this._isTextHighlightOn = false;
                    }
                    this._markAsDirty();
                    return;
                }
                if (this._isTextHighlightOn) {
                    this._cursorOffset = this._textWrapper.length - this._endHighlightIndex;
                    this._isTextHighlightOn = false;
                }
                //ctr + ->
                if (evt && (evt.ctrlKey || evt.metaKey)) {
                    this._cursorOffset = 0;
                    evt.preventDefault();
                }
                this._blinkIsEven = false;
                this._isTextHighlightOn = false;
                this._cursorIndex = -1;
                this._markAsDirty();
                return;
            case 222: // Dead
                if (evt) {
                    //add support for single and double quotes
                    if (evt.code == "Quote") {
                        if (evt.shiftKey) {
                            keyCode = 34;
                            key = '"';
                        }
                        else {
                            keyCode = 39;
                            key = "'";
                        }
                    }
                    else {
                        evt.preventDefault();
                        this._cursorIndex = -1;
                        this.deadKey = true;
                    }
                }
                else {
                    this._cursorIndex = -1;
                    this.deadKey = true;
                }
                break;
        }
        // Printable characters
        if (key &&
            (keyCode === -1 || // Direct access
                keyCode === 32 || // Space
                keyCode === 34 || // "    add support for single and double quotes
                keyCode === 39 || // '
                (keyCode > 47 && keyCode < 64) || // Numbers
                (keyCode > 64 && keyCode < 91) || // Letters
                (keyCode > 159 && keyCode < 193) || // Special characters
                (keyCode > 218 && keyCode < 223) || // Special characters
                (keyCode > 95 && keyCode < 112))) {
            // Numpad
            this._currentKey = key;
            this.onBeforeKeyAddObservable.notifyObservers(this);
            key = this._currentKey;
            if (this._addKey) {
                if (this._isTextHighlightOn) {
                    this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex, key);
                    this._textHasChanged();
                    this._cursorOffset = this._textWrapper.length - (this._startHighlightIndex + 1);
                    this._isTextHighlightOn = false;
                    this._blinkIsEven = false;
                    this._markAsDirty();
                }
                else if (this._cursorOffset === 0) {
                    this.text += key;
                }
                else {
                    var insertPosition = this._textWrapper.length - this._cursorOffset;
                    this._textWrapper.removePart(insertPosition, insertPosition, key);
                    this._textHasChanged();
                }
            }
        }
    };
    /**
     * @param offset
     * @hidden
     */
    InputText.prototype._updateValueFromCursorIndex = function (offset) {
        //update the cursor
        this._blinkIsEven = false;
        if (this._cursorIndex === -1) {
            this._cursorIndex = offset;
        }
        else {
            if (this._cursorIndex < this._cursorOffset) {
                this._endHighlightIndex = this._textWrapper.length - this._cursorIndex;
                this._startHighlightIndex = this._textWrapper.length - this._cursorOffset;
            }
            else if (this._cursorIndex > this._cursorOffset) {
                this._endHighlightIndex = this._textWrapper.length - this._cursorOffset;
                this._startHighlightIndex = this._textWrapper.length - this._cursorIndex;
            }
            else {
                this._isTextHighlightOn = false;
                this._markAsDirty();
                return;
            }
        }
        this._isTextHighlightOn = true;
        this._markAsDirty();
    };
    /**
     * @param evt
     * @hidden
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    InputText.prototype._processDblClick = function (evt) {
        //pre-find the start and end index of the word under cursor, speeds up the rendering
        this._startHighlightIndex = this._textWrapper.length - this._cursorOffset;
        this._endHighlightIndex = this._startHighlightIndex;
        var moveLeft, moveRight;
        do {
            moveRight = this._endHighlightIndex < this._textWrapper.length && this._textWrapper.isWord(this._endHighlightIndex) ? ++this._endHighlightIndex : 0;
            moveLeft = this._startHighlightIndex > 0 && this._textWrapper.isWord(this._startHighlightIndex - 1) ? --this._startHighlightIndex : 0;
        } while (moveLeft || moveRight);
        this._cursorOffset = this._textWrapper.length - this._startHighlightIndex;
        this.onTextHighlightObservable.notifyObservers(this);
        this._isTextHighlightOn = true;
        this._clickedCoordinate = null;
        this._blinkIsEven = true;
        this._cursorIndex = -1;
        this._markAsDirty();
    };
    /** @hidden */
    InputText.prototype._selectAllText = function () {
        this._blinkIsEven = true;
        this._isTextHighlightOn = true;
        this._startHighlightIndex = 0;
        this._endHighlightIndex = this._textWrapper.length;
        this._cursorOffset = this._textWrapper.length;
        this._cursorIndex = -1;
        this._markAsDirty();
    };
    /**
     * Handles the keyboard event
     * @param evt Defines the KeyboardEvent
     */
    InputText.prototype.processKeyboard = function (evt) {
        // process pressed key
        this.processKey(evt.keyCode, evt.key, evt);
        this.onKeyboardEventProcessedObservable.notifyObservers(evt);
    };
    /**
     * @param ev
     * @hidden
     */
    InputText.prototype._onCopyText = function (ev) {
        this._isTextHighlightOn = false;
        //when write permission to clipbaord data is denied
        try {
            ev.clipboardData && ev.clipboardData.setData("text/plain", this._highlightedText);
        }
        catch (_a) { } //pass
        this._host.clipboardData = this._highlightedText;
    };
    /**
     * @param ev
     * @hidden
     */
    InputText.prototype._onCutText = function (ev) {
        if (!this._highlightedText) {
            return;
        }
        this._textWrapper.removePart(this._startHighlightIndex, this._endHighlightIndex);
        this._textHasChanged();
        this._isTextHighlightOn = false;
        this._cursorOffset = this._textWrapper.length - this._startHighlightIndex;
        //when write permission to clipbaord data is denied
        try {
            ev.clipboardData && ev.clipboardData.setData("text/plain", this._highlightedText);
        }
        catch (_a) { } //pass
        this._host.clipboardData = this._highlightedText;
        this._highlightedText = "";
    };
    /**
     * @param ev
     * @hidden
     */
    InputText.prototype._onPasteText = function (ev) {
        var data = "";
        if (ev.clipboardData && ev.clipboardData.types.indexOf("text/plain") !== -1) {
            data = ev.clipboardData.getData("text/plain");
        }
        else {
            //get the cached data; returns blank string by default
            data = this._host.clipboardData;
        }
        var insertPosition = this._textWrapper.length - this._cursorOffset;
        this._textWrapper.removePart(insertPosition, insertPosition, data);
        this._textHasChanged();
    };
    InputText.prototype._draw = function (context) {
        var _this = this;
        context.save();
        this._applyStates(context);
        if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
            context.shadowColor = this.shadowColor;
            context.shadowBlur = this.shadowBlur;
            context.shadowOffsetX = this.shadowOffsetX;
            context.shadowOffsetY = this.shadowOffsetY;
        }
        // Background
        if (this._isFocused) {
            if (this._focusedBackground) {
                context.fillStyle = this._isEnabled ? this._focusedBackground : this._disabledColor;
                context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);
            }
        }
        else if (this._background) {
            context.fillStyle = this._isEnabled ? this._background : this._disabledColor;
            context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);
        }
        if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
            context.shadowBlur = 0;
            context.shadowOffsetX = 0;
            context.shadowOffsetY = 0;
        }
        if (!this._fontOffset || this._wasDirty) {
            this._fontOffset = _control__WEBPACK_IMPORTED_MODULE_2__.Control._GetFontOffset(context.font);
        }
        // Text
        var clipTextLeft = this._currentMeasure.left + this._margin.getValueInPixel(this._host, this._tempParentMeasure.width);
        if (this.color) {
            context.fillStyle = this.color;
        }
        var text = this._beforeRenderText(this._textWrapper);
        if (!this._isFocused && !this._textWrapper.text && this._placeholderText) {
            text = new _textWrapper__WEBPACK_IMPORTED_MODULE_4__.TextWrapper();
            text.text = this._placeholderText;
            if (this._placeholderColor) {
                context.fillStyle = this._placeholderColor;
            }
        }
        this._textWidth = context.measureText(text.text).width;
        var marginWidth = this._margin.getValueInPixel(this._host, this._tempParentMeasure.width) * 2;
        if (this._autoStretchWidth) {
            this.width = Math.min(this._maxWidth.getValueInPixel(this._host, this._tempParentMeasure.width), this._textWidth + marginWidth) + "px";
            this._autoStretchWidth = true; // setting the width will have reset _autoStretchWidth to false!
        }
        var rootY = this._fontOffset.ascent + (this._currentMeasure.height - this._fontOffset.height) / 2;
        var availableWidth = this._width.getValueInPixel(this._host, this._tempParentMeasure.width) - marginWidth;
        context.save();
        context.beginPath();
        context.rect(clipTextLeft, this._currentMeasure.top + (this._currentMeasure.height - this._fontOffset.height) / 2, availableWidth + 2, this._currentMeasure.height);
        context.clip();
        if (this._isFocused && this._textWidth > availableWidth) {
            var textLeft = clipTextLeft - this._textWidth + availableWidth;
            if (!this._scrollLeft) {
                this._scrollLeft = textLeft;
            }
        }
        else {
            this._scrollLeft = clipTextLeft;
        }
        context.fillText(text.text, this._scrollLeft, this._currentMeasure.top + rootY);
        // Cursor
        if (this._isFocused) {
            // Need to move cursor
            if (this._clickedCoordinate) {
                var rightPosition = this._scrollLeft + this._textWidth;
                var absoluteCursorPosition = rightPosition - this._clickedCoordinate;
                var currentSize = 0;
                this._cursorOffset = 0;
                var previousDist = 0;
                do {
                    if (this._cursorOffset) {
                        previousDist = Math.abs(absoluteCursorPosition - currentSize);
                    }
                    this._cursorOffset++;
                    currentSize = context.measureText(text.substr(text.length - this._cursorOffset, this._cursorOffset)).width;
                } while (currentSize < absoluteCursorPosition && text.length >= this._cursorOffset);
                // Find closest move
                if (Math.abs(absoluteCursorPosition - currentSize) > previousDist) {
                    this._cursorOffset--;
                }
                this._blinkIsEven = false;
                this._clickedCoordinate = null;
            }
            // Render cursor
            if (!this._blinkIsEven) {
                var cursorOffsetText = text.substr(text.length - this._cursorOffset);
                var cursorOffsetWidth = context.measureText(cursorOffsetText).width;
                var cursorLeft = this._scrollLeft + this._textWidth - cursorOffsetWidth;
                if (cursorLeft < clipTextLeft) {
                    this._scrollLeft += clipTextLeft - cursorLeft;
                    cursorLeft = clipTextLeft;
                    this._markAsDirty();
                }
                else if (cursorLeft > clipTextLeft + availableWidth) {
                    this._scrollLeft += clipTextLeft + availableWidth - cursorLeft;
                    cursorLeft = clipTextLeft + availableWidth;
                    this._markAsDirty();
                }
                if (!this._isTextHighlightOn) {
                    context.fillRect(cursorLeft, this._currentMeasure.top + (this._currentMeasure.height - this._fontOffset.height) / 2, 2, this._fontOffset.height);
                }
            }
            clearTimeout(this._blinkTimeout);
            this._blinkTimeout = setTimeout(function () {
                _this._blinkIsEven = !_this._blinkIsEven;
                _this._markAsDirty();
            }, 500);
            //show the highlighted text
            if (this._isTextHighlightOn) {
                clearTimeout(this._blinkTimeout);
                var highlightCursorOffsetWidth = context.measureText(text.substring(this._startHighlightIndex)).width;
                var highlightCursorLeft = this._scrollLeft + this._textWidth - highlightCursorOffsetWidth;
                this._highlightedText = text.substring(this._startHighlightIndex, this._endHighlightIndex);
                var width = context.measureText(text.substring(this._startHighlightIndex, this._endHighlightIndex)).width;
                if (highlightCursorLeft < clipTextLeft) {
                    width = width - (clipTextLeft - highlightCursorLeft);
                    if (!width) {
                        // when using left arrow on text.length > availableWidth;
                        // assigns the width of the first letter after clipTextLeft
                        width = context.measureText(text.charAt(text.length - this._cursorOffset)).width;
                    }
                    highlightCursorLeft = clipTextLeft;
                }
                //for transparancy
                context.globalAlpha = this._highligherOpacity;
                context.fillStyle = this._textHighlightColor;
                context.fillRect(highlightCursorLeft, this._currentMeasure.top + (this._currentMeasure.height - this._fontOffset.height) / 2, width, this._fontOffset.height);
                context.globalAlpha = 1.0;
            }
        }
        context.restore();
        // Border
        if (this._thickness) {
            if (this._isFocused) {
                if (this.focusedColor) {
                    context.strokeStyle = this.focusedColor;
                }
            }
            else {
                if (this.color) {
                    context.strokeStyle = this.color;
                }
            }
            context.lineWidth = this._thickness;
            context.strokeRect(this._currentMeasure.left + this._thickness / 2, this._currentMeasure.top + this._thickness / 2, this._currentMeasure.width - this._thickness, this._currentMeasure.height - this._thickness);
        }
        context.restore();
    };
    InputText.prototype._onPointerDown = function (target, coordinates, pointerId, buttonIndex, pi) {
        if (!_super.prototype._onPointerDown.call(this, target, coordinates, pointerId, buttonIndex, pi)) {
            return false;
        }
        if (this.isReadOnly) {
            return true;
        }
        this._clickedCoordinate = coordinates.x;
        this._isTextHighlightOn = false;
        this._highlightedText = "";
        this._cursorIndex = -1;
        this._isPointerDown = true;
        this._host._capturingControl[pointerId] = this;
        this._focusedBy = pi.event.pointerType;
        if (this._host.focusedControl === this) {
            // Move cursor
            clearTimeout(this._blinkTimeout);
            this._markAsDirty();
            return true;
        }
        if (!this._isEnabled) {
            return false;
        }
        this._host.focusedControl = this;
        return true;
    };
    InputText.prototype._onPointerMove = function (target, coordinates, pointerId, pi) {
        if (this._host.focusedControl === this && this._isPointerDown && !this.isReadOnly) {
            this._clickedCoordinate = coordinates.x;
            this._markAsDirty();
            this._updateValueFromCursorIndex(this._cursorOffset);
        }
        _super.prototype._onPointerMove.call(this, target, coordinates, pointerId, pi);
    };
    InputText.prototype._onPointerUp = function (target, coordinates, pointerId, buttonIndex, notifyClick) {
        this._isPointerDown = false;
        delete this._host._capturingControl[pointerId];
        _super.prototype._onPointerUp.call(this, target, coordinates, pointerId, buttonIndex, notifyClick);
    };
    InputText.prototype._beforeRenderText = function (textWrapper) {
        return textWrapper;
    };
    InputText.prototype.dispose = function () {
        _super.prototype.dispose.call(this);
        this.onBlurObservable.clear();
        this.onFocusObservable.clear();
        this.onTextChangedObservable.clear();
        this.onTextCopyObservable.clear();
        this.onTextCutObservable.clear();
        this.onTextPasteObservable.clear();
        this.onTextHighlightObservable.clear();
        this.onKeyboardEventProcessedObservable.clear();
    };
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], InputText.prototype, "promptMessage", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], InputText.prototype, "disableMobilePrompt", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], InputText.prototype, "maxWidth", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], InputText.prototype, "highligherOpacity", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], InputText.prototype, "onFocusSelectAll", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], InputText.prototype, "textHighlightColor", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], InputText.prototype, "margin", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], InputText.prototype, "autoStretchWidth", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], InputText.prototype, "thickness", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], InputText.prototype, "focusedBackground", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], InputText.prototype, "focusedColor", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], InputText.prototype, "background", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], InputText.prototype, "placeholderColor", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], InputText.prototype, "placeholderText", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], InputText.prototype, "deadKey", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], InputText.prototype, "text", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], InputText.prototype, "width", null);
    return InputText;
}(_control__WEBPACK_IMPORTED_MODULE_2__.Control));

(0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.RegisterClass)("BABYLON.GUI.InputText", InputText);


/***/ }),

/***/ "../../../lts/gui/dist/2D/controls/line.js":
/*!*************************************************!*\
  !*** ../../../lts/gui/dist/2D/controls/line.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Line": () => (/* binding */ Line)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Misc/decorators */ "core/Misc/observable");
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./control */ "../../../lts/gui/dist/2D/controls/control.js");
/* harmony import */ var _valueAndUnit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../valueAndUnit */ "../../../lts/gui/dist/2D/valueAndUnit.js");







/** Class used to render 2D lines */
var Line = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(Line, _super);
    /**
     * Creates a new Line
     * @param name defines the control name
     */
    function Line(name) {
        var _this = _super.call(this, name) || this;
        _this.name = name;
        _this._lineWidth = 1;
        _this._x1 = new _valueAndUnit__WEBPACK_IMPORTED_MODULE_3__.ValueAndUnit(0);
        _this._y1 = new _valueAndUnit__WEBPACK_IMPORTED_MODULE_3__.ValueAndUnit(0);
        _this._x2 = new _valueAndUnit__WEBPACK_IMPORTED_MODULE_3__.ValueAndUnit(0);
        _this._y2 = new _valueAndUnit__WEBPACK_IMPORTED_MODULE_3__.ValueAndUnit(0);
        _this._dash = new Array();
        _this._automaticSize = true;
        _this.isHitTestVisible = false;
        _this._horizontalAlignment = _control__WEBPACK_IMPORTED_MODULE_2__.Control.HORIZONTAL_ALIGNMENT_LEFT;
        _this._verticalAlignment = _control__WEBPACK_IMPORTED_MODULE_2__.Control.VERTICAL_ALIGNMENT_TOP;
        return _this;
    }
    Object.defineProperty(Line.prototype, "dash", {
        /** Gets or sets the dash pattern */
        get: function () {
            return this._dash;
        },
        set: function (value) {
            if (this._dash === value) {
                return;
            }
            this._dash = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Line.prototype, "connectedControl", {
        /** Gets or sets the control connected with the line end */
        get: function () {
            return this._connectedControl;
        },
        set: function (value) {
            var _this = this;
            if (this._connectedControl === value) {
                return;
            }
            if (this._connectedControlDirtyObserver && this._connectedControl) {
                this._connectedControl.onDirtyObservable.remove(this._connectedControlDirtyObserver);
                this._connectedControlDirtyObserver = null;
            }
            if (value) {
                this._connectedControlDirtyObserver = value.onDirtyObservable.add(function () { return _this._markAsDirty(); });
            }
            this._connectedControl = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Line.prototype, "x1", {
        /** Gets or sets start coordinates on X axis */
        get: function () {
            return this._x1.toString(this._host);
        },
        set: function (value) {
            if (this._x1.toString(this._host) === value) {
                return;
            }
            if (this._x1.fromString(value)) {
                this._markAsDirty();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Line.prototype, "y1", {
        /** Gets or sets start coordinates on Y axis */
        get: function () {
            return this._y1.toString(this._host);
        },
        set: function (value) {
            if (this._y1.toString(this._host) === value) {
                return;
            }
            if (this._y1.fromString(value)) {
                this._markAsDirty();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Line.prototype, "x2", {
        /** Gets or sets end coordinates on X axis */
        get: function () {
            return this._x2.toString(this._host);
        },
        set: function (value) {
            if (this._x2.toString(this._host) === value) {
                return;
            }
            if (this._x2.fromString(value)) {
                this._markAsDirty();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Line.prototype, "y2", {
        /** Gets or sets end coordinates on Y axis */
        get: function () {
            return this._y2.toString(this._host);
        },
        set: function (value) {
            if (this._y2.toString(this._host) === value) {
                return;
            }
            if (this._y2.fromString(value)) {
                this._markAsDirty();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Line.prototype, "lineWidth", {
        /** Gets or sets line width */
        get: function () {
            return this._lineWidth;
        },
        set: function (value) {
            if (this._lineWidth === value) {
                return;
            }
            this._lineWidth = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Line.prototype, "horizontalAlignment", {
        /** Gets or sets horizontal alignment */
        set: function (value) {
            return;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Line.prototype, "verticalAlignment", {
        /** Gets or sets vertical alignment */
        set: function (value) {
            return;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Line.prototype, "_effectiveX2", {
        get: function () {
            return (this._connectedControl ? this._connectedControl.centerX : 0) + this._x2.getValue(this._host);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Line.prototype, "_effectiveY2", {
        get: function () {
            return (this._connectedControl ? this._connectedControl.centerY : 0) + this._y2.getValue(this._host);
        },
        enumerable: false,
        configurable: true
    });
    Line.prototype._getTypeName = function () {
        return "Line";
    };
    Line.prototype._draw = function (context) {
        context.save();
        if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
            context.shadowColor = this.shadowColor;
            context.shadowBlur = this.shadowBlur;
            context.shadowOffsetX = this.shadowOffsetX;
            context.shadowOffsetY = this.shadowOffsetY;
        }
        this._applyStates(context);
        context.strokeStyle = this.color;
        context.lineWidth = this._lineWidth;
        context.setLineDash(this._dash);
        context.beginPath();
        context.moveTo(this._cachedParentMeasure.left + this._x1.getValue(this._host), this._cachedParentMeasure.top + this._y1.getValue(this._host));
        context.lineTo(this._cachedParentMeasure.left + this._effectiveX2, this._cachedParentMeasure.top + this._effectiveY2);
        context.stroke();
        context.restore();
    };
    Line.prototype._measure = function () {
        // Width / Height
        this._currentMeasure.width = Math.abs(this._x1.getValue(this._host) - this._effectiveX2) + this._lineWidth;
        this._currentMeasure.height = Math.abs(this._y1.getValue(this._host) - this._effectiveY2) + this._lineWidth;
    };
    Line.prototype._computeAlignment = function (parentMeasure) {
        this._currentMeasure.left = parentMeasure.left + Math.min(this._x1.getValue(this._host), this._effectiveX2) - this._lineWidth / 2;
        this._currentMeasure.top = parentMeasure.top + Math.min(this._y1.getValue(this._host), this._effectiveY2) - this._lineWidth / 2;
    };
    /**
     * Move one end of the line given 3D cartesian coordinates.
     * @param position Targeted world position
     * @param scene Scene
     * @param end (opt) Set to true to assign x2 and y2 coordinates of the line. Default assign to x1 and y1.
     */
    Line.prototype.moveToVector3 = function (position, scene, end) {
        if (end === void 0) { end = false; }
        if (!this._host || this.parent !== this._host._rootContainer) {
            core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Tools.Error("Cannot move a control to a vector3 if the control is not at root level");
            return;
        }
        var globalViewport = this._host._getGlobalViewport();
        var projectedPosition = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Vector3.Project(position, core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Matrix.Identity(), scene.getTransformMatrix(), globalViewport);
        this._moveToProjectedPosition(projectedPosition, end);
        if (projectedPosition.z < 0 || projectedPosition.z > 1) {
            this.notRenderable = true;
            return;
        }
        this.notRenderable = false;
    };
    /**
     * Move one end of the line to a position in screen absolute space.
     * @param projectedPosition Position in screen absolute space (X, Y)
     * @param end (opt) Set to true to assign x2 and y2 coordinates of the line. Default assign to x1 and y1.
     */
    Line.prototype._moveToProjectedPosition = function (projectedPosition, end) {
        if (end === void 0) { end = false; }
        var x = projectedPosition.x + this._linkOffsetX.getValue(this._host) + "px";
        var y = projectedPosition.y + this._linkOffsetY.getValue(this._host) + "px";
        if (end) {
            this.x2 = x;
            this.y2 = y;
            this._x2.ignoreAdaptiveScaling = true;
            this._y2.ignoreAdaptiveScaling = true;
        }
        else {
            this.x1 = x;
            this.y1 = y;
            this._x1.ignoreAdaptiveScaling = true;
            this._y1.ignoreAdaptiveScaling = true;
        }
    };
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Line.prototype, "dash", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Line.prototype, "x1", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Line.prototype, "y1", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Line.prototype, "x2", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Line.prototype, "y2", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], Line.prototype, "lineWidth", null);
    return Line;
}(_control__WEBPACK_IMPORTED_MODULE_2__.Control));

(0,core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.RegisterClass)("BABYLON.GUI.Line", Line);


/***/ }),

/***/ "../../../lts/gui/dist/2D/controls/multiLine.js":
/*!******************************************************!*\
  !*** ../../../lts/gui/dist/2D/controls/multiLine.js ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "MultiLine": () => (/* binding */ MultiLine)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Meshes_abstractMesh__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Misc/decorators */ "core/Misc/observable");
/* harmony import */ var core_Meshes_abstractMesh__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Meshes_abstractMesh__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./control */ "../../../lts/gui/dist/2D/controls/control.js");
/* harmony import */ var _multiLinePoint__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../multiLinePoint */ "../../../lts/gui/dist/2D/multiLinePoint.js");






/**
 * Class used to create multi line control
 */
var MultiLine = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(MultiLine, _super);
    /**
     * Creates a new MultiLine
     * @param name defines the control name
     */
    function MultiLine(name) {
        var _this = _super.call(this, name) || this;
        _this.name = name;
        _this._lineWidth = 1;
        /** Function called when a point is updated */
        _this.onPointUpdate = function () {
            _this._markAsDirty();
        };
        _this._automaticSize = true;
        _this.isHitTestVisible = false;
        _this._horizontalAlignment = _control__WEBPACK_IMPORTED_MODULE_2__.Control.HORIZONTAL_ALIGNMENT_LEFT;
        _this._verticalAlignment = _control__WEBPACK_IMPORTED_MODULE_2__.Control.VERTICAL_ALIGNMENT_TOP;
        _this._dash = [];
        _this._points = [];
        return _this;
    }
    Object.defineProperty(MultiLine.prototype, "dash", {
        /** Gets or sets dash pattern */
        get: function () {
            return this._dash;
        },
        set: function (value) {
            if (this._dash === value) {
                return;
            }
            this._dash = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    /**
     * Gets point stored at specified index
     * @param index defines the index to look for
     * @returns the requested point if found
     */
    MultiLine.prototype.getAt = function (index) {
        if (!this._points[index]) {
            this._points[index] = new _multiLinePoint__WEBPACK_IMPORTED_MODULE_3__.MultiLinePoint(this);
        }
        return this._points[index];
    };
    /**
     * Adds new points to the point collection
     * @param items defines the list of items (mesh, control or 2d coordinates) to add
     * @returns the list of created MultiLinePoint
     */
    MultiLine.prototype.add = function () {
        var _this = this;
        var items = [];
        for (var _i = 0; _i < arguments.length; _i++) {
            items[_i] = arguments[_i];
        }
        return items.map(function (item) { return _this.push(item); });
    };
    /**
     * Adds a new point to the point collection
     * @param item defines the item (mesh, control or 2d coordinates) to add
     * @returns the created MultiLinePoint
     */
    MultiLine.prototype.push = function (item) {
        var point = this.getAt(this._points.length);
        if (item == null) {
            return point;
        }
        if (item instanceof core_Meshes_abstractMesh__WEBPACK_IMPORTED_MODULE_1__.AbstractMesh) {
            point.mesh = item;
        }
        else if (item instanceof _control__WEBPACK_IMPORTED_MODULE_2__.Control) {
            point.control = item;
        }
        else if (item.x != null && item.y != null) {
            point.x = item.x;
            point.y = item.y;
        }
        return point;
    };
    /**
     * Remove a specific value or point from the active point collection
     * @param value defines the value or point to remove
     */
    MultiLine.prototype.remove = function (value) {
        var index;
        if (value instanceof _multiLinePoint__WEBPACK_IMPORTED_MODULE_3__.MultiLinePoint) {
            index = this._points.indexOf(value);
            if (index === -1) {
                return;
            }
        }
        else {
            index = value;
        }
        var point = this._points[index];
        if (!point) {
            return;
        }
        point.dispose();
        this._points.splice(index, 1);
    };
    /**
     * Resets this object to initial state (no point)
     */
    MultiLine.prototype.reset = function () {
        while (this._points.length > 0) {
            this.remove(this._points.length - 1);
        }
    };
    /**
     * Resets all links
     */
    MultiLine.prototype.resetLinks = function () {
        this._points.forEach(function (point) {
            if (point != null) {
                point.resetLinks();
            }
        });
    };
    Object.defineProperty(MultiLine.prototype, "lineWidth", {
        /** Gets or sets line width */
        get: function () {
            return this._lineWidth;
        },
        set: function (value) {
            if (this._lineWidth === value) {
                return;
            }
            this._lineWidth = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(MultiLine.prototype, "horizontalAlignment", {
        set: function (value) {
            return;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(MultiLine.prototype, "verticalAlignment", {
        set: function (value) {
            return;
        },
        enumerable: false,
        configurable: true
    });
    MultiLine.prototype._getTypeName = function () {
        return "MultiLine";
    };
    MultiLine.prototype._draw = function (context) {
        context.save();
        if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
            context.shadowColor = this.shadowColor;
            context.shadowBlur = this.shadowBlur;
            context.shadowOffsetX = this.shadowOffsetX;
            context.shadowOffsetY = this.shadowOffsetY;
        }
        this._applyStates(context);
        context.strokeStyle = this.color;
        context.lineWidth = this._lineWidth;
        context.setLineDash(this._dash);
        context.beginPath();
        var first = true; //first index is not necessarily 0
        var previousPoint;
        this._points.forEach(function (point) {
            if (!point) {
                return;
            }
            if (first) {
                context.moveTo(point._point.x, point._point.y);
                first = false;
            }
            else {
                if (point._point.z < 1 && previousPoint.z < 1) {
                    context.lineTo(point._point.x, point._point.y);
                }
                else {
                    context.moveTo(point._point.x, point._point.y);
                }
            }
            previousPoint = point._point;
        });
        context.stroke();
        context.restore();
    };
    MultiLine.prototype._additionalProcessing = function () {
        var _this = this;
        this._minX = null;
        this._minY = null;
        this._maxX = null;
        this._maxY = null;
        this._points.forEach(function (point) {
            if (!point) {
                return;
            }
            point.translate();
            if (_this._minX == null || point._point.x < _this._minX) {
                _this._minX = point._point.x;
            }
            if (_this._minY == null || point._point.y < _this._minY) {
                _this._minY = point._point.y;
            }
            if (_this._maxX == null || point._point.x > _this._maxX) {
                _this._maxX = point._point.x;
            }
            if (_this._maxY == null || point._point.y > _this._maxY) {
                _this._maxY = point._point.y;
            }
        });
        if (this._minX == null) {
            this._minX = 0;
        }
        if (this._minY == null) {
            this._minY = 0;
        }
        if (this._maxX == null) {
            this._maxX = 0;
        }
        if (this._maxY == null) {
            this._maxY = 0;
        }
    };
    MultiLine.prototype._measure = function () {
        if (this._minX == null || this._maxX == null || this._minY == null || this._maxY == null) {
            return;
        }
        this._currentMeasure.width = Math.abs(this._maxX - this._minX) + this._lineWidth;
        this._currentMeasure.height = Math.abs(this._maxY - this._minY) + this._lineWidth;
    };
    MultiLine.prototype._computeAlignment = function () {
        if (this._minX == null || this._minY == null) {
            return;
        }
        this._currentMeasure.left = this._minX - this._lineWidth / 2;
        this._currentMeasure.top = this._minY - this._lineWidth / 2;
    };
    MultiLine.prototype.dispose = function () {
        this.reset();
        _super.prototype.dispose.call(this);
    };
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Meshes_abstractMesh__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MultiLine.prototype, "dash", null);
    return MultiLine;
}(_control__WEBPACK_IMPORTED_MODULE_2__.Control));

(0,core_Meshes_abstractMesh__WEBPACK_IMPORTED_MODULE_1__.RegisterClass)("BABYLON.GUI.MultiLine", MultiLine);


/***/ }),

/***/ "../../../lts/gui/dist/2D/controls/radioButton.js":
/*!********************************************************!*\
  !*** ../../../lts/gui/dist/2D/controls/radioButton.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "RadioButton": () => (/* binding */ RadioButton)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Misc/decorators */ "core/Misc/observable");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./control */ "../../../lts/gui/dist/2D/controls/control.js");
/* harmony import */ var _stackPanel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./stackPanel */ "../../../lts/gui/dist/2D/controls/stackPanel.js");
/* harmony import */ var _textBlock__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./textBlock */ "../../../lts/gui/dist/2D/controls/textBlock.js");







/**
 * Class used to create radio button controls
 */
var RadioButton = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(RadioButton, _super);
    /**
     * Creates a new RadioButton
     * @param name defines the control name
     */
    function RadioButton(name) {
        var _this = _super.call(this, name) || this;
        _this.name = name;
        _this._isChecked = false;
        _this._background = "black";
        _this._checkSizeRatio = 0.8;
        _this._thickness = 1;
        /** Gets or sets group name */
        _this.group = "";
        /** Observable raised when isChecked is changed */
        _this.onIsCheckedChangedObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        _this.isPointerBlocker = true;
        return _this;
    }
    Object.defineProperty(RadioButton.prototype, "thickness", {
        /** Gets or sets border thickness */
        get: function () {
            return this._thickness;
        },
        set: function (value) {
            if (this._thickness === value) {
                return;
            }
            this._thickness = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(RadioButton.prototype, "checkSizeRatio", {
        /** Gets or sets a value indicating the ratio between overall size and check size */
        get: function () {
            return this._checkSizeRatio;
        },
        set: function (value) {
            value = Math.max(Math.min(1, value), 0);
            if (this._checkSizeRatio === value) {
                return;
            }
            this._checkSizeRatio = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(RadioButton.prototype, "background", {
        /** Gets or sets background color */
        get: function () {
            return this._background;
        },
        set: function (value) {
            if (this._background === value) {
                return;
            }
            this._background = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(RadioButton.prototype, "isChecked", {
        /** Gets or sets a boolean indicating if the checkbox is checked or not */
        get: function () {
            return this._isChecked;
        },
        set: function (value) {
            var _this = this;
            if (this._isChecked === value) {
                return;
            }
            this._isChecked = value;
            this._markAsDirty();
            this.onIsCheckedChangedObservable.notifyObservers(value);
            if (this._isChecked && this._host) {
                // Update all controls from same group
                this._host.executeOnAllControls(function (control) {
                    if (control === _this) {
                        return;
                    }
                    if (control.group === undefined) {
                        return;
                    }
                    var childRadio = control;
                    if (childRadio.group === _this.group) {
                        childRadio.isChecked = false;
                    }
                });
            }
        },
        enumerable: false,
        configurable: true
    });
    RadioButton.prototype._getTypeName = function () {
        return "RadioButton";
    };
    RadioButton.prototype._draw = function (context) {
        context.save();
        this._applyStates(context);
        var actualWidth = this._currentMeasure.width - this._thickness;
        var actualHeight = this._currentMeasure.height - this._thickness;
        if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
            context.shadowColor = this.shadowColor;
            context.shadowBlur = this.shadowBlur;
            context.shadowOffsetX = this.shadowOffsetX;
            context.shadowOffsetY = this.shadowOffsetY;
        }
        // Outer
        _control__WEBPACK_IMPORTED_MODULE_2__.Control.drawEllipse(this._currentMeasure.left + this._currentMeasure.width / 2, this._currentMeasure.top + this._currentMeasure.height / 2, this._currentMeasure.width / 2 - this._thickness / 2, this._currentMeasure.height / 2 - this._thickness / 2, context);
        context.fillStyle = this._isEnabled ? this._background : this._disabledColor;
        context.fill();
        if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
            context.shadowBlur = 0;
            context.shadowOffsetX = 0;
            context.shadowOffsetY = 0;
        }
        context.strokeStyle = this.color;
        context.lineWidth = this._thickness;
        context.stroke();
        // Inner
        if (this._isChecked) {
            context.fillStyle = this._isEnabled ? this.color : this._disabledColor;
            var offsetWidth = actualWidth * this._checkSizeRatio;
            var offseHeight = actualHeight * this._checkSizeRatio;
            _control__WEBPACK_IMPORTED_MODULE_2__.Control.drawEllipse(this._currentMeasure.left + this._currentMeasure.width / 2, this._currentMeasure.top + this._currentMeasure.height / 2, offsetWidth / 2 - this._thickness / 2, offseHeight / 2 - this._thickness / 2, context);
            context.fill();
        }
        context.restore();
    };
    // Events
    RadioButton.prototype._onPointerDown = function (target, coordinates, pointerId, buttonIndex, pi) {
        if (!_super.prototype._onPointerDown.call(this, target, coordinates, pointerId, buttonIndex, pi)) {
            return false;
        }
        if (this.isReadOnly) {
            return true;
        }
        if (!this.isChecked) {
            this.isChecked = true;
        }
        return true;
    };
    /**
     * Utility function to easily create a radio button with a header
     * @param title defines the label to use for the header
     * @param group defines the group to use for the radio button
     * @param isChecked defines the initial state of the radio button
     * @param onValueChanged defines the callback to call when value changes
     * @returns a StackPanel containing the radio button and a textBlock
     */
    RadioButton.AddRadioButtonWithHeader = function (title, group, isChecked, onValueChanged) {
        var panel = new _stackPanel__WEBPACK_IMPORTED_MODULE_3__.StackPanel();
        panel.isVertical = false;
        panel.height = "30px";
        var radio = new RadioButton();
        radio.width = "20px";
        radio.height = "20px";
        radio.isChecked = isChecked;
        radio.color = "green";
        radio.group = group;
        radio.onIsCheckedChangedObservable.add(function (value) { return onValueChanged(radio, value); });
        panel.addControl(radio);
        var header = new _textBlock__WEBPACK_IMPORTED_MODULE_4__.TextBlock();
        header.text = title;
        header.width = "180px";
        header.paddingLeft = "5px";
        header.textHorizontalAlignment = _control__WEBPACK_IMPORTED_MODULE_2__.Control.HORIZONTAL_ALIGNMENT_LEFT;
        header.color = "white";
        panel.addControl(header);
        return panel;
    };
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], RadioButton.prototype, "thickness", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], RadioButton.prototype, "group", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], RadioButton.prototype, "checkSizeRatio", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], RadioButton.prototype, "background", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], RadioButton.prototype, "isChecked", null);
    return RadioButton;
}(_control__WEBPACK_IMPORTED_MODULE_2__.Control));

(0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.RegisterClass)("BABYLON.GUI.RadioButton", RadioButton);


/***/ }),

/***/ "../../../lts/gui/dist/2D/controls/rectangle.js":
/*!******************************************************!*\
  !*** ../../../lts/gui/dist/2D/controls/rectangle.js ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Rectangle": () => (/* binding */ Rectangle)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var _container__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./container */ "../../../lts/gui/dist/2D/controls/container.js");
/* harmony import */ var core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core/Misc/decorators */ "core/Misc/observable");
/* harmony import */ var core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2__);




/** Class used to create rectangle container */
var Rectangle = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(Rectangle, _super);
    /**
     * Creates a new Rectangle
     * @param name defines the control name
     */
    function Rectangle(name) {
        var _this = _super.call(this, name) || this;
        _this.name = name;
        _this._thickness = 1;
        _this._cornerRadius = 0;
        return _this;
    }
    Object.defineProperty(Rectangle.prototype, "thickness", {
        /** Gets or sets border thickness */
        get: function () {
            return this._thickness;
        },
        set: function (value) {
            if (this._thickness === value) {
                return;
            }
            this._thickness = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Rectangle.prototype, "cornerRadius", {
        /** Gets or sets the corner radius angle */
        get: function () {
            return this._cornerRadius;
        },
        set: function (value) {
            if (value < 0) {
                value = 0;
            }
            if (this._cornerRadius === value) {
                return;
            }
            this._cornerRadius = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Rectangle.prototype._getTypeName = function () {
        return "Rectangle";
    };
    /** @hidden */
    Rectangle.prototype._computeAdditionnalOffsetX = function () {
        if (this._cornerRadius) {
            // Take in account the aliasing
            return 1;
        }
        return 0;
    };
    /** @hidden */
    Rectangle.prototype._computeAdditionnalOffsetY = function () {
        if (this._cornerRadius) {
            // Take in account the aliasing
            return 1;
        }
        return 0;
    };
    Rectangle.prototype._localDraw = function (context) {
        context.save();
        if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
            context.shadowColor = this.shadowColor;
            context.shadowBlur = this.shadowBlur;
            context.shadowOffsetX = this.shadowOffsetX;
            context.shadowOffsetY = this.shadowOffsetY;
        }
        if (this._background) {
            context.fillStyle = this.typeName === "Button" ? (this.isEnabled ? this._background : this.disabledColor) : this._background;
            if (this._cornerRadius) {
                this._drawRoundedRect(context, this._thickness / 2);
                context.fill();
            }
            else {
                context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);
            }
        }
        if (this._thickness) {
            if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
                context.shadowBlur = 0;
                context.shadowOffsetX = 0;
                context.shadowOffsetY = 0;
            }
            if (this.color) {
                context.strokeStyle = this.color;
            }
            context.lineWidth = this._thickness;
            if (this._cornerRadius) {
                this._drawRoundedRect(context, this._thickness / 2);
                context.stroke();
            }
            else {
                context.strokeRect(this._currentMeasure.left + this._thickness / 2, this._currentMeasure.top + this._thickness / 2, this._currentMeasure.width - this._thickness, this._currentMeasure.height - this._thickness);
            }
        }
        context.restore();
    };
    Rectangle.prototype._additionalProcessing = function (parentMeasure, context) {
        _super.prototype._additionalProcessing.call(this, parentMeasure, context);
        this._measureForChildren.width -= 2 * this._thickness;
        this._measureForChildren.height -= 2 * this._thickness;
        this._measureForChildren.left += this._thickness;
        this._measureForChildren.top += this._thickness;
    };
    Rectangle.prototype._drawRoundedRect = function (context, offset) {
        if (offset === void 0) { offset = 0; }
        var x = this._currentMeasure.left + offset;
        var y = this._currentMeasure.top + offset;
        var width = this._currentMeasure.width - offset * 2;
        var height = this._currentMeasure.height - offset * 2;
        var radius = Math.min(height / 2 - 2, Math.min(width / 2 - 2, this._cornerRadius));
        context.beginPath();
        context.moveTo(x + radius, y);
        context.lineTo(x + width - radius, y);
        context.quadraticCurveTo(x + width, y, x + width, y + radius);
        context.lineTo(x + width, y + height - radius);
        context.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);
        context.lineTo(x + radius, y + height);
        context.quadraticCurveTo(x, y + height, x, y + height - radius);
        context.lineTo(x, y + radius);
        context.quadraticCurveTo(x, y, x + radius, y);
        context.closePath();
    };
    Rectangle.prototype._clipForChildren = function (context) {
        if (this._cornerRadius) {
            this._drawRoundedRect(context, this._thickness);
            context.clip();
        }
    };
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2__.serialize)()
    ], Rectangle.prototype, "thickness", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2__.serialize)()
    ], Rectangle.prototype, "cornerRadius", null);
    return Rectangle;
}(_container__WEBPACK_IMPORTED_MODULE_1__.Container));

(0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2__.RegisterClass)("BABYLON.GUI.Rectangle", Rectangle);


/***/ }),

/***/ "../../../lts/gui/dist/2D/controls/scrollViewers/scrollViewer.js":
/*!***********************************************************************!*\
  !*** ../../../lts/gui/dist/2D/controls/scrollViewers/scrollViewer.js ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "ScrollViewer": () => (/* binding */ ScrollViewer)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var _rectangle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../rectangle */ "../../../lts/gui/dist/2D/controls/rectangle.js");
/* harmony import */ var _grid__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../grid */ "../../../lts/gui/dist/2D/controls/grid.js");
/* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../control */ "../../../lts/gui/dist/2D/controls/control.js");
/* harmony import */ var _scrollViewerWindow__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./scrollViewerWindow */ "../../../lts/gui/dist/2D/controls/scrollViewers/scrollViewerWindow.js");
/* harmony import */ var _sliders_scrollBar__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../sliders/scrollBar */ "../../../lts/gui/dist/2D/controls/sliders/scrollBar.js");
/* harmony import */ var _sliders_imageScrollBar__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../sliders/imageScrollBar */ "../../../lts/gui/dist/2D/controls/sliders/imageScrollBar.js");
/* harmony import */ var core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core/Misc/typeStore */ "core/Misc/observable");
/* harmony import */ var core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_7__);








/**
 * Class used to hold a viewer window and sliders in a grid
 */
var ScrollViewer = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(ScrollViewer, _super);
    /**
     * Creates a new ScrollViewer
     * @param name of ScrollViewer
     * @param isImageBased
     */
    function ScrollViewer(name, isImageBased) {
        var _this = _super.call(this, name) || this;
        _this._barSize = 20;
        _this._pointerIsOver = false;
        _this._wheelPrecision = 0.05;
        _this._thumbLength = 0.5;
        _this._thumbHeight = 1;
        _this._barImageHeight = 1;
        _this._horizontalBarImageHeight = 1;
        _this._verticalBarImageHeight = 1;
        _this._oldWindowContentsWidth = 0;
        _this._oldWindowContentsHeight = 0;
        _this._forceHorizontalBar = false;
        _this._forceVerticalBar = false;
        _this._useImageBar = isImageBased ? isImageBased : false;
        _this.onDirtyObservable.add(function () {
            _this._horizontalBarSpace.color = _this.color;
            _this._verticalBarSpace.color = _this.color;
            _this._dragSpace.color = _this.color;
        });
        _this.onPointerEnterObservable.add(function () {
            _this._pointerIsOver = true;
        });
        _this.onPointerOutObservable.add(function () {
            _this._pointerIsOver = false;
        });
        _this._grid = new _grid__WEBPACK_IMPORTED_MODULE_2__.Grid();
        if (_this._useImageBar) {
            _this._horizontalBar = new _sliders_imageScrollBar__WEBPACK_IMPORTED_MODULE_6__.ImageScrollBar();
            _this._verticalBar = new _sliders_imageScrollBar__WEBPACK_IMPORTED_MODULE_6__.ImageScrollBar();
        }
        else {
            _this._horizontalBar = new _sliders_scrollBar__WEBPACK_IMPORTED_MODULE_5__.ScrollBar();
            _this._verticalBar = new _sliders_scrollBar__WEBPACK_IMPORTED_MODULE_5__.ScrollBar();
        }
        _this._window = new _scrollViewerWindow__WEBPACK_IMPORTED_MODULE_4__._ScrollViewerWindow("scrollViewer_window");
        _this._window.horizontalAlignment = _control__WEBPACK_IMPORTED_MODULE_3__.Control.HORIZONTAL_ALIGNMENT_LEFT;
        _this._window.verticalAlignment = _control__WEBPACK_IMPORTED_MODULE_3__.Control.VERTICAL_ALIGNMENT_TOP;
        _this._grid.addColumnDefinition(1);
        _this._grid.addColumnDefinition(0, true);
        _this._grid.addRowDefinition(1);
        _this._grid.addRowDefinition(0, true);
        _super.prototype.addControl.call(_this, _this._grid);
        _this._grid.addControl(_this._window, 0, 0);
        _this._verticalBarSpace = new _rectangle__WEBPACK_IMPORTED_MODULE_1__.Rectangle();
        _this._verticalBarSpace.horizontalAlignment = _control__WEBPACK_IMPORTED_MODULE_3__.Control.HORIZONTAL_ALIGNMENT_LEFT;
        _this._verticalBarSpace.verticalAlignment = _control__WEBPACK_IMPORTED_MODULE_3__.Control.VERTICAL_ALIGNMENT_TOP;
        _this._verticalBarSpace.thickness = 1;
        _this._grid.addControl(_this._verticalBarSpace, 0, 1);
        _this._addBar(_this._verticalBar, _this._verticalBarSpace, true, Math.PI);
        _this._horizontalBarSpace = new _rectangle__WEBPACK_IMPORTED_MODULE_1__.Rectangle();
        _this._horizontalBarSpace.horizontalAlignment = _control__WEBPACK_IMPORTED_MODULE_3__.Control.HORIZONTAL_ALIGNMENT_LEFT;
        _this._horizontalBarSpace.verticalAlignment = _control__WEBPACK_IMPORTED_MODULE_3__.Control.VERTICAL_ALIGNMENT_TOP;
        _this._horizontalBarSpace.thickness = 1;
        _this._grid.addControl(_this._horizontalBarSpace, 1, 0);
        _this._addBar(_this._horizontalBar, _this._horizontalBarSpace, false, 0);
        _this._dragSpace = new _rectangle__WEBPACK_IMPORTED_MODULE_1__.Rectangle();
        _this._dragSpace.thickness = 1;
        _this._grid.addControl(_this._dragSpace, 1, 1);
        // Colors
        if (!_this._useImageBar) {
            _this.barColor = "grey";
            _this.barBackground = "transparent";
        }
        return _this;
    }
    Object.defineProperty(ScrollViewer.prototype, "horizontalBar", {
        /**
         * Gets the horizontal scrollbar
         */
        get: function () {
            return this._horizontalBar;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ScrollViewer.prototype, "verticalBar", {
        /**
         * Gets the vertical scrollbar
         */
        get: function () {
            return this._verticalBar;
        },
        enumerable: false,
        configurable: true
    });
    /**
     * Adds a new control to the current container
     * @param control defines the control to add
     * @returns the current container
     */
    ScrollViewer.prototype.addControl = function (control) {
        if (!control) {
            return this;
        }
        this._window.addControl(control);
        return this;
    };
    /**
     * Removes a control from the current container
     * @param control defines the control to remove
     * @returns the current container
     */
    ScrollViewer.prototype.removeControl = function (control) {
        this._window.removeControl(control);
        return this;
    };
    Object.defineProperty(ScrollViewer.prototype, "children", {
        /** Gets the list of children */
        get: function () {
            return this._window.children;
        },
        enumerable: false,
        configurable: true
    });
    ScrollViewer.prototype._flagDescendantsAsMatrixDirty = function () {
        for (var _i = 0, _a = this._children; _i < _a.length; _i++) {
            var child = _a[_i];
            child._markMatrixAsDirty();
        }
    };
    Object.defineProperty(ScrollViewer.prototype, "freezeControls", {
        /**
         * Freezes or unfreezes the controls in the window.
         * When controls are frozen, the scroll viewer can render a lot more quickly but updates to positions/sizes of controls
         * are not taken into account. If you want to change positions/sizes, unfreeze, perform the changes then freeze again
         */
        get: function () {
            return this._window.freezeControls;
        },
        set: function (value) {
            this._window.freezeControls = value;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ScrollViewer.prototype, "bucketWidth", {
        /** Gets the bucket width */
        get: function () {
            return this._window.bucketWidth;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ScrollViewer.prototype, "bucketHeight", {
        /** Gets the bucket height */
        get: function () {
            return this._window.bucketHeight;
        },
        enumerable: false,
        configurable: true
    });
    /**
     * Sets the bucket sizes.
     * When freezeControls is true, setting a non-zero bucket size will improve performances by updating only
     * controls that are visible. The bucket sizes is used to subdivide (internally) the window area to smaller areas into which
     * controls are dispatched. So, the size should be roughly equals to the mean size of all the controls of
     * the window. To disable the usage of buckets, sets either width or height (or both) to 0.
     * Please note that using this option will raise the memory usage (the higher the bucket sizes, the less memory
     * used), that's why it is not enabled by default.
     * @param width width of the bucket
     * @param height height of the bucket
     */
    ScrollViewer.prototype.setBucketSizes = function (width, height) {
        this._window.setBucketSizes(width, height);
    };
    Object.defineProperty(ScrollViewer.prototype, "forceHorizontalBar", {
        /**
         * Forces the horizontal scroll bar to be displayed
         */
        get: function () {
            return this._forceHorizontalBar;
        },
        set: function (value) {
            this._grid.setRowDefinition(1, value ? this._barSize : 0, true);
            this._horizontalBar.isVisible = value;
            this._forceHorizontalBar = value;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ScrollViewer.prototype, "forceVerticalBar", {
        /**
         * Forces the vertical scroll bar to be displayed
         */
        get: function () {
            return this._forceVerticalBar;
        },
        set: function (value) {
            this._grid.setColumnDefinition(1, value ? this._barSize : 0, true);
            this._verticalBar.isVisible = value;
            this._forceVerticalBar = value;
        },
        enumerable: false,
        configurable: true
    });
    /** Reset the scroll viewer window to initial size */
    ScrollViewer.prototype.resetWindow = function () {
        this._window.width = "100%";
        this._window.height = "100%";
    };
    ScrollViewer.prototype._getTypeName = function () {
        return "ScrollViewer";
    };
    ScrollViewer.prototype._buildClientSizes = function () {
        var ratio = this.host.idealRatio;
        this._window.parentClientWidth = this._currentMeasure.width - (this._verticalBar.isVisible || this.forceVerticalBar ? this._barSize * ratio : 0) - 2 * this.thickness;
        this._window.parentClientHeight = this._currentMeasure.height - (this._horizontalBar.isVisible || this.forceHorizontalBar ? this._barSize * ratio : 0) - 2 * this.thickness;
        this._clientWidth = this._window.parentClientWidth;
        this._clientHeight = this._window.parentClientHeight;
    };
    ScrollViewer.prototype._additionalProcessing = function (parentMeasure, context) {
        _super.prototype._additionalProcessing.call(this, parentMeasure, context);
        this._buildClientSizes();
    };
    ScrollViewer.prototype._postMeasure = function () {
        _super.prototype._postMeasure.call(this);
        this._updateScroller();
        this._setWindowPosition(false);
    };
    Object.defineProperty(ScrollViewer.prototype, "wheelPrecision", {
        /**
         * Gets or sets the mouse wheel precision
         * from 0 to 1 with a default value of 0.05
         * */
        get: function () {
            return this._wheelPrecision;
        },
        set: function (value) {
            if (this._wheelPrecision === value) {
                return;
            }
            if (value < 0) {
                value = 0;
            }
            if (value > 1) {
                value = 1;
            }
            this._wheelPrecision = value;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ScrollViewer.prototype, "scrollBackground", {
        /** Gets or sets the scroll bar container background color */
        get: function () {
            return this._horizontalBarSpace.background;
        },
        set: function (color) {
            if (this._horizontalBarSpace.background === color) {
                return;
            }
            this._horizontalBarSpace.background = color;
            this._verticalBarSpace.background = color;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ScrollViewer.prototype, "barColor", {
        /** Gets or sets the bar color */
        get: function () {
            return this._barColor;
        },
        set: function (color) {
            if (this._barColor === color) {
                return;
            }
            this._barColor = color;
            this._horizontalBar.color = color;
            this._verticalBar.color = color;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ScrollViewer.prototype, "thumbImage", {
        /** Gets or sets the bar image */
        get: function () {
            return this._barImage;
        },
        set: function (value) {
            if (this._barImage === value) {
                return;
            }
            this._barImage = value;
            var hb = this._horizontalBar;
            var vb = this._verticalBar;
            hb.thumbImage = value;
            vb.thumbImage = value;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ScrollViewer.prototype, "horizontalThumbImage", {
        /** Gets or sets the horizontal bar image */
        get: function () {
            return this._horizontalBarImage;
        },
        set: function (value) {
            if (this._horizontalBarImage === value) {
                return;
            }
            this._horizontalBarImage = value;
            var hb = this._horizontalBar;
            hb.thumbImage = value;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ScrollViewer.prototype, "verticalThumbImage", {
        /** Gets or sets the vertical bar image */
        get: function () {
            return this._verticalBarImage;
        },
        set: function (value) {
            if (this._verticalBarImage === value) {
                return;
            }
            this._verticalBarImage = value;
            var vb = this._verticalBar;
            vb.thumbImage = value;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ScrollViewer.prototype, "barSize", {
        /** Gets or sets the size of the bar */
        get: function () {
            return this._barSize;
        },
        set: function (value) {
            if (this._barSize === value) {
                return;
            }
            this._barSize = value;
            this._markAsDirty();
            if (this._horizontalBar.isVisible) {
                this._grid.setRowDefinition(1, this._barSize, true);
            }
            if (this._verticalBar.isVisible) {
                this._grid.setColumnDefinition(1, this._barSize, true);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ScrollViewer.prototype, "thumbLength", {
        /** Gets or sets the length of the thumb */
        get: function () {
            return this._thumbLength;
        },
        set: function (value) {
            if (this._thumbLength === value) {
                return;
            }
            if (value <= 0) {
                value = 0.1;
            }
            if (value > 1) {
                value = 1;
            }
            this._thumbLength = value;
            var hb = this._horizontalBar;
            var vb = this._verticalBar;
            hb.thumbLength = value;
            vb.thumbLength = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ScrollViewer.prototype, "thumbHeight", {
        /** Gets or sets the height of the thumb */
        get: function () {
            return this._thumbHeight;
        },
        set: function (value) {
            if (this._thumbHeight === value) {
                return;
            }
            if (value <= 0) {
                value = 0.1;
            }
            if (value > 1) {
                value = 1;
            }
            this._thumbHeight = value;
            var hb = this._horizontalBar;
            var vb = this._verticalBar;
            hb.thumbHeight = value;
            vb.thumbHeight = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ScrollViewer.prototype, "barImageHeight", {
        /** Gets or sets the height of the bar image */
        get: function () {
            return this._barImageHeight;
        },
        set: function (value) {
            if (this._barImageHeight === value) {
                return;
            }
            if (value <= 0) {
                value = 0.1;
            }
            if (value > 1) {
                value = 1;
            }
            this._barImageHeight = value;
            var hb = this._horizontalBar;
            var vb = this._verticalBar;
            hb.barImageHeight = value;
            vb.barImageHeight = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ScrollViewer.prototype, "horizontalBarImageHeight", {
        /** Gets or sets the height of the horizontal bar image */
        get: function () {
            return this._horizontalBarImageHeight;
        },
        set: function (value) {
            if (this._horizontalBarImageHeight === value) {
                return;
            }
            if (value <= 0) {
                value = 0.1;
            }
            if (value > 1) {
                value = 1;
            }
            this._horizontalBarImageHeight = value;
            var hb = this._horizontalBar;
            hb.barImageHeight = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ScrollViewer.prototype, "verticalBarImageHeight", {
        /** Gets or sets the height of the vertical bar image */
        get: function () {
            return this._verticalBarImageHeight;
        },
        set: function (value) {
            if (this._verticalBarImageHeight === value) {
                return;
            }
            if (value <= 0) {
                value = 0.1;
            }
            if (value > 1) {
                value = 1;
            }
            this._verticalBarImageHeight = value;
            var vb = this._verticalBar;
            vb.barImageHeight = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ScrollViewer.prototype, "barBackground", {
        /** Gets or sets the bar background */
        get: function () {
            return this._barBackground;
        },
        set: function (color) {
            if (this._barBackground === color) {
                return;
            }
            this._barBackground = color;
            var hb = this._horizontalBar;
            var vb = this._verticalBar;
            hb.background = color;
            vb.background = color;
            this._dragSpace.background = color;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ScrollViewer.prototype, "barImage", {
        /** Gets or sets the bar background image */
        get: function () {
            return this._barBackgroundImage;
        },
        set: function (value) {
            this._barBackgroundImage = value;
            var hb = this._horizontalBar;
            var vb = this._verticalBar;
            hb.backgroundImage = value;
            vb.backgroundImage = value;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ScrollViewer.prototype, "horizontalBarImage", {
        /** Gets or sets the horizontal bar background image */
        get: function () {
            return this._horizontalBarBackgroundImage;
        },
        set: function (value) {
            this._horizontalBarBackgroundImage = value;
            var hb = this._horizontalBar;
            hb.backgroundImage = value;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ScrollViewer.prototype, "verticalBarImage", {
        /** Gets or sets the vertical bar background image */
        get: function () {
            return this._verticalBarBackgroundImage;
        },
        set: function (value) {
            this._verticalBarBackgroundImage = value;
            var vb = this._verticalBar;
            vb.backgroundImage = value;
        },
        enumerable: false,
        configurable: true
    });
    ScrollViewer.prototype._setWindowPosition = function (force) {
        if (force === void 0) { force = true; }
        var ratio = this.host.idealRatio;
        var windowContentsWidth = this._window._currentMeasure.width;
        var windowContentsHeight = this._window._currentMeasure.height;
        if (!force && this._oldWindowContentsWidth === windowContentsWidth && this._oldWindowContentsHeight === windowContentsHeight) {
            return;
        }
        this._oldWindowContentsWidth = windowContentsWidth;
        this._oldWindowContentsHeight = windowContentsHeight;
        var _endLeft = this._clientWidth - windowContentsWidth;
        var _endTop = this._clientHeight - windowContentsHeight;
        var newLeft = (this._horizontalBar.value / ratio) * _endLeft + "px";
        var newTop = (this._verticalBar.value / ratio) * _endTop + "px";
        if (newLeft !== this._window.left) {
            this._window.left = newLeft;
            if (!this.freezeControls) {
                this._rebuildLayout = true;
            }
        }
        if (newTop !== this._window.top) {
            this._window.top = newTop;
            if (!this.freezeControls) {
                this._rebuildLayout = true;
            }
        }
    };
    /** @hidden */
    ScrollViewer.prototype._updateScroller = function () {
        var windowContentsWidth = this._window._currentMeasure.width;
        var windowContentsHeight = this._window._currentMeasure.height;
        if (this._horizontalBar.isVisible && windowContentsWidth <= this._clientWidth && !this.forceHorizontalBar) {
            this._grid.setRowDefinition(1, 0, true);
            this._horizontalBar.isVisible = false;
            this._horizontalBar.value = 0;
            this._rebuildLayout = true;
        }
        else if (!this._horizontalBar.isVisible && (windowContentsWidth > this._clientWidth || this.forceHorizontalBar)) {
            this._grid.setRowDefinition(1, this._barSize, true);
            this._horizontalBar.isVisible = true;
            this._rebuildLayout = true;
        }
        if (this._verticalBar.isVisible && windowContentsHeight <= this._clientHeight && !this.forceVerticalBar) {
            this._grid.setColumnDefinition(1, 0, true);
            this._verticalBar.isVisible = false;
            this._verticalBar.value = 0;
            this._rebuildLayout = true;
        }
        else if (!this._verticalBar.isVisible && (windowContentsHeight > this._clientHeight || this.forceVerticalBar)) {
            this._grid.setColumnDefinition(1, this._barSize, true);
            this._verticalBar.isVisible = true;
            this._rebuildLayout = true;
        }
        this._buildClientSizes();
        var ratio = this.host.idealRatio;
        this._horizontalBar.thumbWidth = this._thumbLength * 0.9 * (this._clientWidth / ratio) + "px";
        this._verticalBar.thumbWidth = this._thumbLength * 0.9 * (this._clientHeight / ratio) + "px";
    };
    ScrollViewer.prototype._link = function (host) {
        _super.prototype._link.call(this, host);
        this._attachWheel();
    };
    /**
     * @param barControl
     * @param barContainer
     * @param isVertical
     * @param rotation
     * @hidden
     */
    ScrollViewer.prototype._addBar = function (barControl, barContainer, isVertical, rotation) {
        var _this = this;
        barControl.paddingLeft = 0;
        barControl.width = "100%";
        barControl.height = "100%";
        barControl.barOffset = 0;
        barControl.value = 0;
        barControl.maximum = 1;
        barControl.horizontalAlignment = _control__WEBPACK_IMPORTED_MODULE_3__.Control.HORIZONTAL_ALIGNMENT_CENTER;
        barControl.verticalAlignment = _control__WEBPACK_IMPORTED_MODULE_3__.Control.VERTICAL_ALIGNMENT_CENTER;
        barControl.isVertical = isVertical;
        barControl.rotation = rotation;
        barControl.isVisible = false;
        barContainer.addControl(barControl);
        barControl.onValueChangedObservable.add(function () {
            _this._setWindowPosition();
        });
    };
    /** @hidden */
    ScrollViewer.prototype._attachWheel = function () {
        var _this = this;
        if (!this._host || this._onWheelObserver) {
            return;
        }
        this._onWheelObserver = this.onWheelObservable.add(function (pi) {
            if (!_this._pointerIsOver || _this.isReadOnly) {
                return;
            }
            if (_this._verticalBar.isVisible == true) {
                if (pi.y < 0 && _this._verticalBar.value > 0) {
                    _this._verticalBar.value -= _this._wheelPrecision;
                }
                else if (pi.y > 0 && _this._verticalBar.value < _this._verticalBar.maximum) {
                    _this._verticalBar.value += _this._wheelPrecision;
                }
            }
            if (_this._horizontalBar.isVisible == true) {
                if (pi.x < 0 && _this._horizontalBar.value < _this._horizontalBar.maximum) {
                    _this._horizontalBar.value += _this._wheelPrecision;
                }
                else if (pi.x > 0 && _this._horizontalBar.value > 0) {
                    _this._horizontalBar.value -= _this._wheelPrecision;
                }
            }
        });
    };
    ScrollViewer.prototype._renderHighlightSpecific = function (context) {
        if (!this.isHighlighted) {
            return;
        }
        _super.prototype._renderHighlightSpecific.call(this, context);
        this._grid._renderHighlightSpecific(context);
        context.restore();
    };
    /** Releases associated resources */
    ScrollViewer.prototype.dispose = function () {
        this.onWheelObservable.remove(this._onWheelObserver);
        this._onWheelObserver = null;
        _super.prototype.dispose.call(this);
    };
    return ScrollViewer;
}(_rectangle__WEBPACK_IMPORTED_MODULE_1__.Rectangle));

(0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_7__.RegisterClass)("BABYLON.GUI.ScrollViewer", ScrollViewer);


/***/ }),

/***/ "../../../lts/gui/dist/2D/controls/scrollViewers/scrollViewerWindow.js":
/*!*****************************************************************************!*\
  !*** ../../../lts/gui/dist/2D/controls/scrollViewers/scrollViewerWindow.js ***!
  \*****************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "_ScrollViewerWindow": () => (/* binding */ _ScrollViewerWindow)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var _measure__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../measure */ "../../../lts/gui/dist/2D/measure.js");
/* harmony import */ var _container__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../container */ "../../../lts/gui/dist/2D/controls/container.js");
/* harmony import */ var _valueAndUnit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../valueAndUnit */ "../../../lts/gui/dist/2D/valueAndUnit.js");
/* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../control */ "../../../lts/gui/dist/2D/controls/control.js");





/**
 * Class used to hold a the container for ScrollViewer
 * @hidden
 */
var _ScrollViewerWindow = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(_ScrollViewerWindow, _super);
    /**
     * Creates a new ScrollViewerWindow
     * @param name of ScrollViewerWindow
     */
    function _ScrollViewerWindow(name) {
        var _this = _super.call(this, name) || this;
        _this._freezeControls = false;
        _this._bucketWidth = 0;
        _this._bucketHeight = 0;
        _this._buckets = {};
        return _this;
    }
    Object.defineProperty(_ScrollViewerWindow.prototype, "freezeControls", {
        get: function () {
            return this._freezeControls;
        },
        set: function (value) {
            if (this._freezeControls === value) {
                return;
            }
            if (!value) {
                this._restoreMeasures();
            }
            // trigger a full normal layout calculation to be sure all children have their measures up to date
            this._freezeControls = false;
            var textureSize = this.host.getSize();
            var renderWidth = textureSize.width;
            var renderHeight = textureSize.height;
            var context = this.host.getContext();
            var measure = new _measure__WEBPACK_IMPORTED_MODULE_1__.Measure(0, 0, renderWidth, renderHeight);
            this.host._numLayoutCalls = 0;
            this.host._rootContainer._layout(measure, context);
            // in freeze mode, prepare children measures accordingly
            if (value) {
                this._updateMeasures();
                if (this._useBuckets()) {
                    this._makeBuckets();
                }
            }
            this._freezeControls = value;
            this.host.markAsDirty(); // redraw with the (new) current settings
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(_ScrollViewerWindow.prototype, "bucketWidth", {
        get: function () {
            return this._bucketWidth;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(_ScrollViewerWindow.prototype, "bucketHeight", {
        get: function () {
            return this._bucketHeight;
        },
        enumerable: false,
        configurable: true
    });
    _ScrollViewerWindow.prototype.setBucketSizes = function (width, height) {
        this._bucketWidth = width;
        this._bucketHeight = height;
        if (this._useBuckets()) {
            if (this._freezeControls) {
                this._makeBuckets();
            }
        }
        else {
            this._buckets = {};
        }
    };
    _ScrollViewerWindow.prototype._useBuckets = function () {
        return this._bucketWidth > 0 && this._bucketHeight > 0;
    };
    _ScrollViewerWindow.prototype._makeBuckets = function () {
        this._buckets = {};
        this._bucketLen = Math.ceil(this.widthInPixels / this._bucketWidth);
        this._dispatchInBuckets(this._children);
        this._oldLeft = null;
        this._oldTop = null;
    };
    _ScrollViewerWindow.prototype._dispatchInBuckets = function (children) {
        for (var i = 0; i < children.length; ++i) {
            var child = children[i];
            var bStartX = Math.max(0, Math.floor((child._customData._origLeft - this._customData.origLeft) / this._bucketWidth)), bEndX = Math.floor((child._customData._origLeft - this._customData.origLeft + child._currentMeasure.width - 1) / this._bucketWidth), bEndY = Math.floor((child._customData._origTop - this._customData.origTop + child._currentMeasure.height - 1) / this._bucketHeight);
            var bStartY = Math.max(0, Math.floor((child._customData._origTop - this._customData.origTop) / this._bucketHeight));
            while (bStartY <= bEndY) {
                for (var x = bStartX; x <= bEndX; ++x) {
                    var bucket = bStartY * this._bucketLen + x;
                    var lstc = this._buckets[bucket];
                    if (!lstc) {
                        lstc = [];
                        this._buckets[bucket] = lstc;
                    }
                    lstc.push(child);
                }
                bStartY++;
            }
            if (child instanceof _container__WEBPACK_IMPORTED_MODULE_2__.Container && child._children.length > 0) {
                this._dispatchInBuckets(child._children);
            }
        }
    };
    // reset left and top measures for the window and all its children
    _ScrollViewerWindow.prototype._updateMeasures = function () {
        var left = this.leftInPixels | 0, top = this.topInPixels | 0;
        this._measureForChildren.left -= left;
        this._measureForChildren.top -= top;
        this._currentMeasure.left -= left;
        this._currentMeasure.top -= top;
        this._customData.origLeftForChildren = this._measureForChildren.left;
        this._customData.origTopForChildren = this._measureForChildren.top;
        this._customData.origLeft = this._currentMeasure.left;
        this._customData.origTop = this._currentMeasure.top;
        this._updateChildrenMeasures(this._children, left, top);
    };
    _ScrollViewerWindow.prototype._updateChildrenMeasures = function (children, left, top) {
        for (var i = 0; i < children.length; ++i) {
            var child = children[i];
            child._currentMeasure.left -= left;
            child._currentMeasure.top -= top;
            child._customData._origLeft = child._currentMeasure.left; // save the original left and top values for each child
            child._customData._origTop = child._currentMeasure.top;
            if (child instanceof _container__WEBPACK_IMPORTED_MODULE_2__.Container && child._children.length > 0) {
                this._updateChildrenMeasures(child._children, left, top);
            }
        }
    };
    _ScrollViewerWindow.prototype._restoreMeasures = function () {
        var left = this.leftInPixels | 0, top = this.topInPixels | 0;
        this._measureForChildren.left = this._customData.origLeftForChildren + left;
        this._measureForChildren.top = this._customData.origTopForChildren + top;
        this._currentMeasure.left = this._customData.origLeft + left;
        this._currentMeasure.top = this._customData.origTop + top;
    };
    _ScrollViewerWindow.prototype._getTypeName = function () {
        return "ScrollViewerWindow";
    };
    /**
     * @param parentMeasure
     * @param context
     * @hidden
     */
    _ScrollViewerWindow.prototype._additionalProcessing = function (parentMeasure, context) {
        _super.prototype._additionalProcessing.call(this, parentMeasure, context);
        this._parentMeasure = parentMeasure;
        this._measureForChildren.left = this._currentMeasure.left;
        this._measureForChildren.top = this._currentMeasure.top;
        this._measureForChildren.width = parentMeasure.width;
        this._measureForChildren.height = parentMeasure.height;
    };
    /**
     * @param parentMeasure
     * @param context
     * @hidden
     */
    _ScrollViewerWindow.prototype._layout = function (parentMeasure, context) {
        if (this._freezeControls) {
            this.invalidateRect(); // will trigger a redraw of the window
            return false;
        }
        return _super.prototype._layout.call(this, parentMeasure, context);
    };
    _ScrollViewerWindow.prototype._scrollChildren = function (children, left, top) {
        for (var i = 0; i < children.length; ++i) {
            var child = children[i];
            child._currentMeasure.left = child._customData._origLeft + left;
            child._currentMeasure.top = child._customData._origTop + top;
            child._isClipped = false; // clipping will be handled by _draw and the call to _intersectsRect()
            if (child instanceof _container__WEBPACK_IMPORTED_MODULE_2__.Container && child._children.length > 0) {
                this._scrollChildren(child._children, left, top);
            }
        }
    };
    _ScrollViewerWindow.prototype._scrollChildrenWithBuckets = function (left, top, scrollLeft, scrollTop) {
        var bStartX = Math.max(0, Math.floor(-left / this._bucketWidth)), bEndX = Math.floor((-left + this._parentMeasure.width - 1) / this._bucketWidth), bEndY = Math.floor((-top + this._parentMeasure.height - 1) / this._bucketHeight);
        var bStartY = Math.max(0, Math.floor(-top / this._bucketHeight));
        while (bStartY <= bEndY) {
            for (var x = bStartX; x <= bEndX; ++x) {
                var bucket = bStartY * this._bucketLen + x, lstc = this._buckets[bucket];
                if (lstc) {
                    for (var i = 0; i < lstc.length; ++i) {
                        var child = lstc[i];
                        child._currentMeasure.left = child._customData._origLeft + scrollLeft;
                        child._currentMeasure.top = child._customData._origTop + scrollTop;
                        child._isClipped = false; // clipping will be handled by _draw and the call to _intersectsRect()
                    }
                }
            }
            bStartY++;
        }
    };
    /**
     * @param context
     * @param invalidatedRectangle
     * @hidden
     */
    _ScrollViewerWindow.prototype._draw = function (context, invalidatedRectangle) {
        if (!this._freezeControls) {
            _super.prototype._draw.call(this, context, invalidatedRectangle);
            return;
        }
        this._localDraw(context);
        if (this.clipChildren) {
            this._clipForChildren(context);
        }
        var left = this.leftInPixels | 0, top = this.topInPixels | 0;
        if (this._useBuckets()) {
            if (this._oldLeft !== null && this._oldTop !== null) {
                this._scrollChildrenWithBuckets(this._oldLeft, this._oldTop, left, top);
                this._scrollChildrenWithBuckets(left, top, left, top);
            }
            else {
                this._scrollChildren(this._children, left, top);
            }
        }
        else {
            this._scrollChildren(this._children, left, top);
        }
        this._oldLeft = left;
        this._oldTop = top;
        for (var _i = 0, _a = this._children; _i < _a.length; _i++) {
            var child = _a[_i];
            if (!child._intersectsRect(this._parentMeasure)) {
                continue;
            }
            child._render(context, this._parentMeasure);
        }
    };
    _ScrollViewerWindow.prototype._postMeasure = function () {
        if (this._freezeControls) {
            _super.prototype._postMeasure.call(this);
            return;
        }
        var maxWidth = this.parentClientWidth;
        var maxHeight = this.parentClientHeight;
        for (var _i = 0, _a = this.children; _i < _a.length; _i++) {
            var child = _a[_i];
            if (!child.isVisible || child.notRenderable) {
                continue;
            }
            if (child.horizontalAlignment === _control__WEBPACK_IMPORTED_MODULE_4__.Control.HORIZONTAL_ALIGNMENT_CENTER) {
                child._offsetLeft(this._currentMeasure.left - child._currentMeasure.left);
            }
            if (child.verticalAlignment === _control__WEBPACK_IMPORTED_MODULE_4__.Control.VERTICAL_ALIGNMENT_CENTER) {
                child._offsetTop(this._currentMeasure.top - child._currentMeasure.top);
            }
            maxWidth = Math.max(maxWidth, child._currentMeasure.left - this._currentMeasure.left + child._currentMeasure.width + child.paddingRightInPixels);
            maxHeight = Math.max(maxHeight, child._currentMeasure.top - this._currentMeasure.top + child._currentMeasure.height + child.paddingBottomInPixels);
        }
        if (this._currentMeasure.width !== maxWidth) {
            this._width.updateInPlace(maxWidth, _valueAndUnit__WEBPACK_IMPORTED_MODULE_3__.ValueAndUnit.UNITMODE_PIXEL);
            this._currentMeasure.width = maxWidth;
            this._rebuildLayout = true;
            this._isDirty = true;
        }
        if (this._currentMeasure.height !== maxHeight) {
            this._height.updateInPlace(maxHeight, _valueAndUnit__WEBPACK_IMPORTED_MODULE_3__.ValueAndUnit.UNITMODE_PIXEL);
            this._currentMeasure.height = maxHeight;
            this._rebuildLayout = true;
            this._isDirty = true;
        }
        _super.prototype._postMeasure.call(this);
    };
    return _ScrollViewerWindow;
}(_container__WEBPACK_IMPORTED_MODULE_2__.Container));



/***/ }),

/***/ "../../../lts/gui/dist/2D/controls/selector.js":
/*!*****************************************************!*\
  !*** ../../../lts/gui/dist/2D/controls/selector.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "CheckboxGroup": () => (/* binding */ CheckboxGroup),
/* harmony export */   "RadioGroup": () => (/* binding */ RadioGroup),
/* harmony export */   "SelectionPanel": () => (/* binding */ SelectionPanel),
/* harmony export */   "SelectorGroup": () => (/* binding */ SelectorGroup),
/* harmony export */   "SliderGroup": () => (/* binding */ SliderGroup)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var _rectangle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rectangle */ "../../../lts/gui/dist/2D/controls/rectangle.js");
/* harmony import */ var _stackPanel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./stackPanel */ "../../../lts/gui/dist/2D/controls/stackPanel.js");
/* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./control */ "../../../lts/gui/dist/2D/controls/control.js");
/* harmony import */ var _textBlock__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./textBlock */ "../../../lts/gui/dist/2D/controls/textBlock.js");
/* harmony import */ var _checkbox__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./checkbox */ "../../../lts/gui/dist/2D/controls/checkbox.js");
/* harmony import */ var _radioButton__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./radioButton */ "../../../lts/gui/dist/2D/controls/radioButton.js");
/* harmony import */ var _sliders_slider__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./sliders/slider */ "../../../lts/gui/dist/2D/controls/sliders/slider.js");
/* harmony import */ var _container__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./container */ "../../../lts/gui/dist/2D/controls/container.js");









/** Class used to create a RadioGroup
 * which contains groups of radio buttons
 */
var SelectorGroup = /** @class */ (function () {
    /**
     * Creates a new SelectorGroup
     * @param name of group, used as a group heading
     */
    function SelectorGroup(
    /** name of SelectorGroup */
    name) {
        this.name = name;
        this._groupPanel = new _stackPanel__WEBPACK_IMPORTED_MODULE_2__.StackPanel();
        this._selectors = new Array();
        this._groupPanel.verticalAlignment = _control__WEBPACK_IMPORTED_MODULE_3__.Control.VERTICAL_ALIGNMENT_TOP;
        this._groupPanel.horizontalAlignment = _control__WEBPACK_IMPORTED_MODULE_3__.Control.HORIZONTAL_ALIGNMENT_LEFT;
        this._groupHeader = this._addGroupHeader(name);
    }
    Object.defineProperty(SelectorGroup.prototype, "groupPanel", {
        /** Gets the groupPanel of the SelectorGroup  */
        get: function () {
            return this._groupPanel;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SelectorGroup.prototype, "selectors", {
        /** Gets the selectors array */
        get: function () {
            return this._selectors;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SelectorGroup.prototype, "header", {
        /** Gets and sets the group header */
        get: function () {
            return this._groupHeader.text;
        },
        set: function (label) {
            if (this._groupHeader.text === "label") {
                return;
            }
            this._groupHeader.text = label;
        },
        enumerable: false,
        configurable: true
    });
    /**
     * @param text
     * @hidden
     */
    SelectorGroup.prototype._addGroupHeader = function (text) {
        var groupHeading = new _textBlock__WEBPACK_IMPORTED_MODULE_4__.TextBlock("groupHead", text);
        groupHeading.width = 0.9;
        groupHeading.height = "30px";
        groupHeading.textWrapping = true;
        groupHeading.color = "black";
        groupHeading.horizontalAlignment = _control__WEBPACK_IMPORTED_MODULE_3__.Control.HORIZONTAL_ALIGNMENT_LEFT;
        groupHeading.textHorizontalAlignment = _control__WEBPACK_IMPORTED_MODULE_3__.Control.HORIZONTAL_ALIGNMENT_LEFT;
        groupHeading.left = "2px";
        this._groupPanel.addControl(groupHeading);
        return groupHeading;
    };
    /**
     * @param selectorNb
     * @hidden
     */
    SelectorGroup.prototype._getSelector = function (selectorNb) {
        if (selectorNb < 0 || selectorNb >= this._selectors.length) {
            return;
        }
        return this._selectors[selectorNb];
    };
    /** Removes the selector at the given position
     * @param selectorNb the position of the selector within the group
     */
    SelectorGroup.prototype.removeSelector = function (selectorNb) {
        if (selectorNb < 0 || selectorNb >= this._selectors.length) {
            return;
        }
        this._groupPanel.removeControl(this._selectors[selectorNb]);
        this._selectors.splice(selectorNb, 1);
    };
    return SelectorGroup;
}());

/** Class used to create a CheckboxGroup
 * which contains groups of checkbox buttons
 */
var CheckboxGroup = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(CheckboxGroup, _super);
    function CheckboxGroup() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    /** Adds a checkbox as a control
     * @param text is the label for the selector
     * @param func is the function called when the Selector is checked
     * @param checked is true when Selector is checked
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    CheckboxGroup.prototype.addCheckbox = function (text, func, checked) {
        if (func === void 0) { func = function (s) { }; }
        if (checked === void 0) { checked = false; }
        checked = checked || false;
        var button = new _checkbox__WEBPACK_IMPORTED_MODULE_5__.Checkbox();
        button.width = "20px";
        button.height = "20px";
        button.color = "#364249";
        button.background = "#CCCCCC";
        button.horizontalAlignment = _control__WEBPACK_IMPORTED_MODULE_3__.Control.HORIZONTAL_ALIGNMENT_LEFT;
        button.onIsCheckedChangedObservable.add(function (state) {
            func(state);
        });
        var _selector = _control__WEBPACK_IMPORTED_MODULE_3__.Control.AddHeader(button, text, "200px", { isHorizontal: true, controlFirst: true });
        _selector.height = "30px";
        _selector.horizontalAlignment = _control__WEBPACK_IMPORTED_MODULE_3__.Control.HORIZONTAL_ALIGNMENT_LEFT;
        _selector.left = "4px";
        this.groupPanel.addControl(_selector);
        this.selectors.push(_selector);
        button.isChecked = checked;
        if (this.groupPanel.parent && this.groupPanel.parent.parent) {
            button.color = this.groupPanel.parent.parent.buttonColor;
            button.background = this.groupPanel.parent.parent.buttonBackground;
        }
    };
    /**
     * @param selectorNb
     * @param label
     * @hidden
     */
    CheckboxGroup.prototype._setSelectorLabel = function (selectorNb, label) {
        this.selectors[selectorNb].children[1].text = label;
    };
    /**
     * @param selectorNb
     * @param color
     * @hidden
     */
    CheckboxGroup.prototype._setSelectorLabelColor = function (selectorNb, color) {
        this.selectors[selectorNb].children[1].color = color;
    };
    /**
     * @param selectorNb
     * @param color
     * @hidden
     */
    CheckboxGroup.prototype._setSelectorButtonColor = function (selectorNb, color) {
        this.selectors[selectorNb].children[0].color = color;
    };
    /**
     * @param selectorNb
     * @param color
     * @hidden
     */
    CheckboxGroup.prototype._setSelectorButtonBackground = function (selectorNb, color) {
        this.selectors[selectorNb].children[0].background = color;
    };
    return CheckboxGroup;
}(SelectorGroup));

/** Class used to create a RadioGroup
 * which contains groups of radio buttons
 */
var RadioGroup = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(RadioGroup, _super);
    function RadioGroup() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this._selectNb = 0;
        return _this;
    }
    /** Adds a radio button as a control
     * @param label is the label for the selector
     * @param func is the function called when the Selector is checked
     * @param checked is true when Selector is checked
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    RadioGroup.prototype.addRadio = function (label, func, checked) {
        if (func === void 0) { func = function (n) { }; }
        if (checked === void 0) { checked = false; }
        var nb = this._selectNb++;
        var button = new _radioButton__WEBPACK_IMPORTED_MODULE_6__.RadioButton();
        button.name = label;
        button.width = "20px";
        button.height = "20px";
        button.color = "#364249";
        button.background = "#CCCCCC";
        button.group = this.name;
        button.horizontalAlignment = _control__WEBPACK_IMPORTED_MODULE_3__.Control.HORIZONTAL_ALIGNMENT_LEFT;
        button.onIsCheckedChangedObservable.add(function (state) {
            if (state) {
                func(nb);
            }
        });
        var _selector = _control__WEBPACK_IMPORTED_MODULE_3__.Control.AddHeader(button, label, "200px", { isHorizontal: true, controlFirst: true });
        _selector.height = "30px";
        _selector.horizontalAlignment = _control__WEBPACK_IMPORTED_MODULE_3__.Control.HORIZONTAL_ALIGNMENT_LEFT;
        _selector.left = "4px";
        this.groupPanel.addControl(_selector);
        this.selectors.push(_selector);
        button.isChecked = checked;
        if (this.groupPanel.parent && this.groupPanel.parent.parent) {
            button.color = this.groupPanel.parent.parent.buttonColor;
            button.background = this.groupPanel.parent.parent.buttonBackground;
        }
    };
    /**
     * @param selectorNb
     * @param label
     * @hidden
     */
    RadioGroup.prototype._setSelectorLabel = function (selectorNb, label) {
        this.selectors[selectorNb].children[1].text = label;
    };
    /**
     * @param selectorNb
     * @param color
     * @hidden
     */
    RadioGroup.prototype._setSelectorLabelColor = function (selectorNb, color) {
        this.selectors[selectorNb].children[1].color = color;
    };
    /**
     * @param selectorNb
     * @param color
     * @hidden
     */
    RadioGroup.prototype._setSelectorButtonColor = function (selectorNb, color) {
        this.selectors[selectorNb].children[0].color = color;
    };
    /**
     * @param selectorNb
     * @param color
     * @hidden
     */
    RadioGroup.prototype._setSelectorButtonBackground = function (selectorNb, color) {
        this.selectors[selectorNb].children[0].background = color;
    };
    return RadioGroup;
}(SelectorGroup));

/** Class used to create a SliderGroup
 * which contains groups of slider buttons
 */
var SliderGroup = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(SliderGroup, _super);
    function SliderGroup() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    /**
     * Adds a slider to the SelectorGroup
     * @param label is the label for the SliderBar
     * @param func is the function called when the Slider moves
     * @param unit is a string describing the units used, eg degrees or metres
     * @param min is the minimum value for the Slider
     * @param max is the maximum value for the Slider
     * @param value is the start value for the Slider between min and max
     * @param onValueChange is the function used to format the value displayed, eg radians to degrees
     */
    SliderGroup.prototype.addSlider = function (label, 
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    func, unit, min, max, value, onValueChange) {
        if (func === void 0) { func = function (v) { }; }
        if (unit === void 0) { unit = "Units"; }
        if (min === void 0) { min = 0; }
        if (max === void 0) { max = 0; }
        if (value === void 0) { value = 0; }
        if (onValueChange === void 0) { onValueChange = function (v) {
            return v | 0;
        }; }
        var button = new _sliders_slider__WEBPACK_IMPORTED_MODULE_7__.Slider();
        button.name = unit;
        button.value = value;
        button.minimum = min;
        button.maximum = max;
        button.width = 0.9;
        button.height = "20px";
        button.color = "#364249";
        button.background = "#CCCCCC";
        button.borderColor = "black";
        button.horizontalAlignment = _control__WEBPACK_IMPORTED_MODULE_3__.Control.HORIZONTAL_ALIGNMENT_LEFT;
        button.left = "4px";
        button.paddingBottom = "4px";
        button.onValueChangedObservable.add(function (value) {
            button.parent.children[0].text = button.parent.children[0].name + ": " + onValueChange(value) + " " + button.name;
            func(value);
        });
        var _selector = _control__WEBPACK_IMPORTED_MODULE_3__.Control.AddHeader(button, label + ": " + onValueChange(value) + " " + unit, "30px", { isHorizontal: false, controlFirst: false });
        _selector.height = "60px";
        _selector.horizontalAlignment = _control__WEBPACK_IMPORTED_MODULE_3__.Control.HORIZONTAL_ALIGNMENT_LEFT;
        _selector.left = "4px";
        _selector.children[0].name = label;
        this.groupPanel.addControl(_selector);
        this.selectors.push(_selector);
        if (this.groupPanel.parent && this.groupPanel.parent.parent) {
            button.color = this.groupPanel.parent.parent.buttonColor;
            button.background = this.groupPanel.parent.parent.buttonBackground;
        }
    };
    /**
     * @param selectorNb
     * @param label
     * @hidden
     */
    SliderGroup.prototype._setSelectorLabel = function (selectorNb, label) {
        this.selectors[selectorNb].children[0].name = label;
        this.selectors[selectorNb].children[0].text =
            label + ": " + this.selectors[selectorNb].children[1].value + " " + this.selectors[selectorNb].children[1].name;
    };
    /**
     * @param selectorNb
     * @param color
     * @hidden
     */
    SliderGroup.prototype._setSelectorLabelColor = function (selectorNb, color) {
        this.selectors[selectorNb].children[0].color = color;
    };
    /**
     * @param selectorNb
     * @param color
     * @hidden
     */
    SliderGroup.prototype._setSelectorButtonColor = function (selectorNb, color) {
        this.selectors[selectorNb].children[1].color = color;
    };
    /**
     * @param selectorNb
     * @param color
     * @hidden
     */
    SliderGroup.prototype._setSelectorButtonBackground = function (selectorNb, color) {
        this.selectors[selectorNb].children[1].background = color;
    };
    return SliderGroup;
}(SelectorGroup));

/** Class used to hold the controls for the checkboxes, radio buttons and sliders
 * @see https://doc.babylonjs.com/how_to/selector
 */
var SelectionPanel = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(SelectionPanel, _super);
    /**
     * Creates a new SelectionPanel
     * @param name of SelectionPanel
     * @param groups is an array of SelectionGroups
     */
    function SelectionPanel(
    /** name of SelectionPanel */
    name, 
    /** an array of SelectionGroups */
    groups) {
        if (groups === void 0) { groups = []; }
        var _this = _super.call(this, name) || this;
        _this.name = name;
        _this.groups = groups;
        _this._buttonColor = "#364249";
        _this._buttonBackground = "#CCCCCC";
        _this._headerColor = "black";
        _this._barColor = "white";
        _this._barHeight = "2px";
        _this._spacerHeight = "20px";
        _this._bars = new Array();
        _this._groups = groups;
        _this.thickness = 2;
        _this._panel = new _stackPanel__WEBPACK_IMPORTED_MODULE_2__.StackPanel();
        _this._panel.verticalAlignment = _control__WEBPACK_IMPORTED_MODULE_3__.Control.VERTICAL_ALIGNMENT_TOP;
        _this._panel.horizontalAlignment = _control__WEBPACK_IMPORTED_MODULE_3__.Control.HORIZONTAL_ALIGNMENT_LEFT;
        _this._panel.top = 5;
        _this._panel.left = 5;
        _this._panel.width = 0.95;
        if (groups.length > 0) {
            for (var i = 0; i < groups.length - 1; i++) {
                _this._panel.addControl(groups[i].groupPanel);
                _this._addSpacer();
            }
            _this._panel.addControl(groups[groups.length - 1].groupPanel);
        }
        _this.addControl(_this._panel);
        return _this;
    }
    SelectionPanel.prototype._getTypeName = function () {
        return "SelectionPanel";
    };
    Object.defineProperty(SelectionPanel.prototype, "panel", {
        /** Gets the (stack) panel of the SelectionPanel  */
        get: function () {
            return this._panel;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SelectionPanel.prototype, "headerColor", {
        /** Gets or sets the headerColor */
        get: function () {
            return this._headerColor;
        },
        set: function (color) {
            if (this._headerColor === color) {
                return;
            }
            this._headerColor = color;
            this._setHeaderColor();
        },
        enumerable: false,
        configurable: true
    });
    SelectionPanel.prototype._setHeaderColor = function () {
        for (var i = 0; i < this._groups.length; i++) {
            this._groups[i].groupPanel.children[0].color = this._headerColor;
        }
    };
    Object.defineProperty(SelectionPanel.prototype, "buttonColor", {
        /** Gets or sets the button color */
        get: function () {
            return this._buttonColor;
        },
        set: function (color) {
            if (this._buttonColor === color) {
                return;
            }
            this._buttonColor = color;
            this._setbuttonColor();
        },
        enumerable: false,
        configurable: true
    });
    SelectionPanel.prototype._setbuttonColor = function () {
        for (var i = 0; i < this._groups.length; i++) {
            for (var j = 0; j < this._groups[i].selectors.length; j++) {
                this._groups[i]._setSelectorButtonColor(j, this._buttonColor);
            }
        }
    };
    Object.defineProperty(SelectionPanel.prototype, "labelColor", {
        /** Gets or sets the label color */
        get: function () {
            return this._labelColor;
        },
        set: function (color) {
            if (this._labelColor === color) {
                return;
            }
            this._labelColor = color;
            this._setLabelColor();
        },
        enumerable: false,
        configurable: true
    });
    SelectionPanel.prototype._setLabelColor = function () {
        for (var i = 0; i < this._groups.length; i++) {
            for (var j = 0; j < this._groups[i].selectors.length; j++) {
                this._groups[i]._setSelectorLabelColor(j, this._labelColor);
            }
        }
    };
    Object.defineProperty(SelectionPanel.prototype, "buttonBackground", {
        /** Gets or sets the button background */
        get: function () {
            return this._buttonBackground;
        },
        set: function (color) {
            if (this._buttonBackground === color) {
                return;
            }
            this._buttonBackground = color;
            this._setButtonBackground();
        },
        enumerable: false,
        configurable: true
    });
    SelectionPanel.prototype._setButtonBackground = function () {
        for (var i = 0; i < this._groups.length; i++) {
            for (var j = 0; j < this._groups[i].selectors.length; j++) {
                this._groups[i]._setSelectorButtonBackground(j, this._buttonBackground);
            }
        }
    };
    Object.defineProperty(SelectionPanel.prototype, "barColor", {
        /** Gets or sets the color of separator bar */
        get: function () {
            return this._barColor;
        },
        set: function (color) {
            if (this._barColor === color) {
                return;
            }
            this._barColor = color;
            this._setBarColor();
        },
        enumerable: false,
        configurable: true
    });
    SelectionPanel.prototype._setBarColor = function () {
        for (var i = 0; i < this._bars.length; i++) {
            this._bars[i].children[0].background = this._barColor;
        }
    };
    Object.defineProperty(SelectionPanel.prototype, "barHeight", {
        /** Gets or sets the height of separator bar */
        get: function () {
            return this._barHeight;
        },
        set: function (value) {
            if (this._barHeight === value) {
                return;
            }
            this._barHeight = value;
            this._setBarHeight();
        },
        enumerable: false,
        configurable: true
    });
    SelectionPanel.prototype._setBarHeight = function () {
        for (var i = 0; i < this._bars.length; i++) {
            this._bars[i].children[0].height = this._barHeight;
        }
    };
    Object.defineProperty(SelectionPanel.prototype, "spacerHeight", {
        /** Gets or sets the height of spacers*/
        get: function () {
            return this._spacerHeight;
        },
        set: function (value) {
            if (this._spacerHeight === value) {
                return;
            }
            this._spacerHeight = value;
            this._setSpacerHeight();
        },
        enumerable: false,
        configurable: true
    });
    SelectionPanel.prototype._setSpacerHeight = function () {
        for (var i = 0; i < this._bars.length; i++) {
            this._bars[i].height = this._spacerHeight;
        }
    };
    /** Adds a bar between groups */
    SelectionPanel.prototype._addSpacer = function () {
        var separator = new _container__WEBPACK_IMPORTED_MODULE_8__.Container();
        separator.width = 1;
        separator.height = this._spacerHeight;
        separator.horizontalAlignment = _control__WEBPACK_IMPORTED_MODULE_3__.Control.HORIZONTAL_ALIGNMENT_LEFT;
        var bar = new _rectangle__WEBPACK_IMPORTED_MODULE_1__.Rectangle();
        bar.width = 1;
        bar.height = this._barHeight;
        bar.horizontalAlignment = _control__WEBPACK_IMPORTED_MODULE_3__.Control.HORIZONTAL_ALIGNMENT_LEFT;
        bar.verticalAlignment = _control__WEBPACK_IMPORTED_MODULE_3__.Control.VERTICAL_ALIGNMENT_CENTER;
        bar.background = this._barColor;
        bar.color = "transparent";
        separator.addControl(bar);
        this._panel.addControl(separator);
        this._bars.push(separator);
    };
    /** Add a group to the selection panel
     * @param group is the selector group to add
     */
    SelectionPanel.prototype.addGroup = function (group) {
        if (this._groups.length > 0) {
            this._addSpacer();
        }
        this._panel.addControl(group.groupPanel);
        this._groups.push(group);
        group.groupPanel.children[0].color = this._headerColor;
        for (var j = 0; j < group.selectors.length; j++) {
            group._setSelectorButtonColor(j, this._buttonColor);
            group._setSelectorButtonBackground(j, this._buttonBackground);
        }
    };
    /** Remove the group from the given position
     * @param groupNb is the position of the group in the list
     */
    SelectionPanel.prototype.removeGroup = function (groupNb) {
        if (groupNb < 0 || groupNb >= this._groups.length) {
            return;
        }
        var group = this._groups[groupNb];
        this._panel.removeControl(group.groupPanel);
        this._groups.splice(groupNb, 1);
        if (groupNb < this._bars.length) {
            this._panel.removeControl(this._bars[groupNb]);
            this._bars.splice(groupNb, 1);
        }
    };
    /** Change a group header label
     * @param label is the new group header label
     * @param groupNb is the number of the group to relabel
     * */
    SelectionPanel.prototype.setHeaderName = function (label, groupNb) {
        if (groupNb < 0 || groupNb >= this._groups.length) {
            return;
        }
        var group = this._groups[groupNb];
        group.groupPanel.children[0].text = label;
    };
    /** Change selector label to the one given
     * @param label is the new selector label
     * @param groupNb is the number of the groupcontaining the selector
     * @param selectorNb is the number of the selector within a group to relabel
     * */
    SelectionPanel.prototype.relabel = function (label, groupNb, selectorNb) {
        if (groupNb < 0 || groupNb >= this._groups.length) {
            return;
        }
        var group = this._groups[groupNb];
        if (selectorNb < 0 || selectorNb >= group.selectors.length) {
            return;
        }
        group._setSelectorLabel(selectorNb, label);
    };
    /** For a given group position remove the selector at the given position
     * @param groupNb is the number of the group to remove the selector from
     * @param selectorNb is the number of the selector within the group
     */
    SelectionPanel.prototype.removeFromGroupSelector = function (groupNb, selectorNb) {
        if (groupNb < 0 || groupNb >= this._groups.length) {
            return;
        }
        var group = this._groups[groupNb];
        if (selectorNb < 0 || selectorNb >= group.selectors.length) {
            return;
        }
        group.removeSelector(selectorNb);
    };
    /** For a given group position of correct type add a checkbox button
     * @param groupNb is the number of the group to remove the selector from
     * @param label is the label for the selector
     * @param func is the function called when the Selector is checked
     * @param checked is true when Selector is checked
     */
    SelectionPanel.prototype.addToGroupCheckbox = function (groupNb, label, func, checked) {
        if (func === void 0) { func = function () { }; }
        if (checked === void 0) { checked = false; }
        if (groupNb < 0 || groupNb >= this._groups.length) {
            return;
        }
        var group = this._groups[groupNb];
        group.addCheckbox(label, func, checked);
    };
    /** For a given group position of correct type add a radio button
     * @param groupNb is the number of the group to remove the selector from
     * @param label is the label for the selector
     * @param func is the function called when the Selector is checked
     * @param checked is true when Selector is checked
     */
    SelectionPanel.prototype.addToGroupRadio = function (groupNb, label, func, checked) {
        if (func === void 0) { func = function () { }; }
        if (checked === void 0) { checked = false; }
        if (groupNb < 0 || groupNb >= this._groups.length) {
            return;
        }
        var group = this._groups[groupNb];
        group.addRadio(label, func, checked);
    };
    /**
     * For a given slider group add a slider
     * @param groupNb is the number of the group to add the slider to
     * @param label is the label for the Slider
     * @param func is the function called when the Slider moves
     * @param unit is a string describing the units used, eg degrees or metres
     * @param min is the minimum value for the Slider
     * @param max is the maximum value for the Slider
     * @param value is the start value for the Slider between min and max
     * @param onVal is the function used to format the value displayed, eg radians to degrees
     */
    SelectionPanel.prototype.addToGroupSlider = function (groupNb, label, func, unit, min, max, value, onVal) {
        if (func === void 0) { func = function () { }; }
        if (unit === void 0) { unit = "Units"; }
        if (min === void 0) { min = 0; }
        if (max === void 0) { max = 0; }
        if (value === void 0) { value = 0; }
        if (onVal === void 0) { onVal = function (v) {
            return v | 0;
        }; }
        if (groupNb < 0 || groupNb >= this._groups.length) {
            return;
        }
        var group = this._groups[groupNb];
        group.addSlider(label, func, unit, min, max, value, onVal);
    };
    return SelectionPanel;
}(_rectangle__WEBPACK_IMPORTED_MODULE_1__.Rectangle));



/***/ }),

/***/ "../../../lts/gui/dist/2D/controls/sliders/baseSlider.js":
/*!***************************************************************!*\
  !*** ../../../lts/gui/dist/2D/controls/sliders/baseSlider.js ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "BaseSlider": () => (/* binding */ BaseSlider)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Misc/decorators */ "core/Misc/observable");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../control */ "../../../lts/gui/dist/2D/controls/control.js");
/* harmony import */ var _valueAndUnit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../valueAndUnit */ "../../../lts/gui/dist/2D/valueAndUnit.js");





/**
 * Class used to create slider controls
 */
var BaseSlider = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(BaseSlider, _super);
    /**
     * Creates a new BaseSlider
     * @param name defines the control name
     */
    function BaseSlider(name) {
        var _this = _super.call(this, name) || this;
        _this.name = name;
        _this._thumbWidth = new _valueAndUnit__WEBPACK_IMPORTED_MODULE_3__.ValueAndUnit(20, _valueAndUnit__WEBPACK_IMPORTED_MODULE_3__.ValueAndUnit.UNITMODE_PIXEL, false);
        _this._minimum = 0;
        _this._maximum = 100;
        _this._value = 50;
        _this._isVertical = false;
        _this._barOffset = new _valueAndUnit__WEBPACK_IMPORTED_MODULE_3__.ValueAndUnit(5, _valueAndUnit__WEBPACK_IMPORTED_MODULE_3__.ValueAndUnit.UNITMODE_PIXEL, false);
        _this._isThumbClamped = false;
        _this._displayThumb = true;
        _this._step = 0;
        _this._lastPointerDownId = -1;
        // Shared rendering info
        _this._effectiveBarOffset = 0;
        /** Observable raised when the slider value changes */
        _this.onValueChangedObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        // Events
        _this._pointerIsDown = false;
        _this.isPointerBlocker = true;
        return _this;
    }
    Object.defineProperty(BaseSlider.prototype, "displayThumb", {
        /** Gets or sets a boolean indicating if the thumb must be rendered */
        get: function () {
            return this._displayThumb;
        },
        set: function (value) {
            if (this._displayThumb === value) {
                return;
            }
            this._displayThumb = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BaseSlider.prototype, "step", {
        /** Gets or sets a step to apply to values (0 by default) */
        get: function () {
            return this._step;
        },
        set: function (value) {
            if (this._step === value) {
                return;
            }
            this._step = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BaseSlider.prototype, "barOffset", {
        /** Gets or sets main bar offset (ie. the margin applied to the value bar) */
        get: function () {
            return this._barOffset.toString(this._host);
        },
        set: function (value) {
            if (this._barOffset.toString(this._host) === value) {
                return;
            }
            if (this._barOffset.fromString(value)) {
                this._markAsDirty();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BaseSlider.prototype, "barOffsetInPixels", {
        /** Gets main bar offset in pixels*/
        get: function () {
            return this._barOffset.getValueInPixel(this._host, this._cachedParentMeasure.width);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BaseSlider.prototype, "thumbWidth", {
        /** Gets or sets thumb width */
        get: function () {
            return this._thumbWidth.toString(this._host);
        },
        set: function (value) {
            if (this._thumbWidth.toString(this._host) === value) {
                return;
            }
            if (this._thumbWidth.fromString(value)) {
                this._markAsDirty();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BaseSlider.prototype, "thumbWidthInPixels", {
        /** Gets thumb width in pixels */
        get: function () {
            return this._thumbWidth.getValueInPixel(this._host, this._cachedParentMeasure.width);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BaseSlider.prototype, "minimum", {
        /** Gets or sets minimum value */
        get: function () {
            return this._minimum;
        },
        set: function (value) {
            if (this._minimum === value) {
                return;
            }
            this._minimum = value;
            this._markAsDirty();
            this.value = Math.max(Math.min(this.value, this._maximum), this._minimum);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BaseSlider.prototype, "maximum", {
        /** Gets or sets maximum value */
        get: function () {
            return this._maximum;
        },
        set: function (value) {
            if (this._maximum === value) {
                return;
            }
            this._maximum = value;
            this._markAsDirty();
            this.value = Math.max(Math.min(this.value, this._maximum), this._minimum);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BaseSlider.prototype, "value", {
        /** Gets or sets current value */
        get: function () {
            return this._value;
        },
        set: function (value) {
            value = Math.max(Math.min(value, this._maximum), this._minimum);
            if (this._value === value) {
                return;
            }
            this._value = value;
            this._markAsDirty();
            this.onValueChangedObservable.notifyObservers(this._value);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BaseSlider.prototype, "isVertical", {
        /**Gets or sets a boolean indicating if the slider should be vertical or horizontal */
        get: function () {
            return this._isVertical;
        },
        set: function (value) {
            if (this._isVertical === value) {
                return;
            }
            this._isVertical = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(BaseSlider.prototype, "isThumbClamped", {
        /** Gets or sets a value indicating if the thumb can go over main bar extends */
        get: function () {
            return this._isThumbClamped;
        },
        set: function (value) {
            if (this._isThumbClamped === value) {
                return;
            }
            this._isThumbClamped = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    BaseSlider.prototype._getTypeName = function () {
        return "BaseSlider";
    };
    BaseSlider.prototype._getThumbPosition = function () {
        if (this.isVertical) {
            return ((this.maximum - this.value) / (this.maximum - this.minimum)) * this._backgroundBoxLength;
        }
        return ((this.value - this.minimum) / (this.maximum - this.minimum)) * this._backgroundBoxLength;
    };
    BaseSlider.prototype._getThumbThickness = function (type) {
        var thumbThickness = 0;
        switch (type) {
            case "circle":
                if (this._thumbWidth.isPixel) {
                    thumbThickness = Math.max(this._thumbWidth.getValue(this._host), this._backgroundBoxThickness);
                }
                else {
                    thumbThickness = this._backgroundBoxThickness * this._thumbWidth.getValue(this._host);
                }
                break;
            case "rectangle":
                if (this._thumbWidth.isPixel) {
                    thumbThickness = Math.min(this._thumbWidth.getValue(this._host), this._backgroundBoxThickness);
                }
                else {
                    thumbThickness = this._backgroundBoxThickness * this._thumbWidth.getValue(this._host);
                }
        }
        return thumbThickness;
    };
    BaseSlider.prototype._prepareRenderingData = function (type) {
        // Main bar
        this._effectiveBarOffset = 0;
        this._renderLeft = this._currentMeasure.left;
        this._renderTop = this._currentMeasure.top;
        this._renderWidth = this._currentMeasure.width;
        this._renderHeight = this._currentMeasure.height;
        this._backgroundBoxLength = Math.max(this._currentMeasure.width, this._currentMeasure.height);
        this._backgroundBoxThickness = Math.min(this._currentMeasure.width, this._currentMeasure.height);
        this._effectiveThumbThickness = this._getThumbThickness(type);
        if (this.displayThumb) {
            this._backgroundBoxLength -= this._effectiveThumbThickness;
        }
        //throw error when height is less than width for vertical slider
        if (this.isVertical && this._currentMeasure.height < this._currentMeasure.width) {
            console.error("Height should be greater than width");
            return;
        }
        if (this._barOffset.isPixel) {
            this._effectiveBarOffset = Math.min(this._barOffset.getValue(this._host), this._backgroundBoxThickness);
        }
        else {
            this._effectiveBarOffset = this._backgroundBoxThickness * this._barOffset.getValue(this._host);
        }
        this._backgroundBoxThickness -= this._effectiveBarOffset * 2;
        if (this.isVertical) {
            this._renderLeft += this._effectiveBarOffset;
            if (!this.isThumbClamped && this.displayThumb) {
                this._renderTop += this._effectiveThumbThickness / 2;
            }
            this._renderHeight = this._backgroundBoxLength;
            this._renderWidth = this._backgroundBoxThickness;
        }
        else {
            this._renderTop += this._effectiveBarOffset;
            if (!this.isThumbClamped && this.displayThumb) {
                this._renderLeft += this._effectiveThumbThickness / 2;
            }
            this._renderHeight = this._backgroundBoxThickness;
            this._renderWidth = this._backgroundBoxLength;
        }
    };
    /**
     * @param x
     * @param y
     * @hidden
     */
    BaseSlider.prototype._updateValueFromPointer = function (x, y) {
        if (this.rotation != 0) {
            this._invertTransformMatrix.transformCoordinates(x, y, this._transformedPosition);
            x = this._transformedPosition.x;
            y = this._transformedPosition.y;
        }
        var value;
        if (this._isVertical) {
            value = this._minimum + (1 - (y - this._currentMeasure.top) / this._currentMeasure.height) * (this._maximum - this._minimum);
        }
        else {
            value = this._minimum + ((x - this._currentMeasure.left) / this._currentMeasure.width) * (this._maximum - this._minimum);
        }
        this.value = this._step ? Math.round(value / this._step) * this._step : value;
    };
    BaseSlider.prototype._onPointerDown = function (target, coordinates, pointerId, buttonIndex, pi) {
        if (!_super.prototype._onPointerDown.call(this, target, coordinates, pointerId, buttonIndex, pi)) {
            return false;
        }
        if (this.isReadOnly) {
            return true;
        }
        this._pointerIsDown = true;
        this._updateValueFromPointer(coordinates.x, coordinates.y);
        this._host._capturingControl[pointerId] = this;
        this._lastPointerDownId = pointerId;
        return true;
    };
    BaseSlider.prototype._onPointerMove = function (target, coordinates, pointerId, pi) {
        // Only listen to pointer move events coming from the last pointer to click on the element (To support dual vr controller interaction)
        if (pointerId != this._lastPointerDownId) {
            return;
        }
        if (this._pointerIsDown && !this.isReadOnly) {
            this._updateValueFromPointer(coordinates.x, coordinates.y);
        }
        _super.prototype._onPointerMove.call(this, target, coordinates, pointerId, pi);
    };
    BaseSlider.prototype._onPointerUp = function (target, coordinates, pointerId, buttonIndex, notifyClick) {
        this._pointerIsDown = false;
        delete this._host._capturingControl[pointerId];
        _super.prototype._onPointerUp.call(this, target, coordinates, pointerId, buttonIndex, notifyClick);
    };
    BaseSlider.prototype._onCanvasBlur = function () {
        this._forcePointerUp();
        _super.prototype._onCanvasBlur.call(this);
    };
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], BaseSlider.prototype, "displayThumb", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], BaseSlider.prototype, "step", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], BaseSlider.prototype, "barOffset", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], BaseSlider.prototype, "thumbWidth", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], BaseSlider.prototype, "minimum", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], BaseSlider.prototype, "maximum", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], BaseSlider.prototype, "value", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], BaseSlider.prototype, "isVertical", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], BaseSlider.prototype, "isThumbClamped", null);
    return BaseSlider;
}(_control__WEBPACK_IMPORTED_MODULE_2__.Control));



/***/ }),

/***/ "../../../lts/gui/dist/2D/controls/sliders/imageBasedSlider.js":
/*!*********************************************************************!*\
  !*** ../../../lts/gui/dist/2D/controls/sliders/imageBasedSlider.js ***!
  \*********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "ImageBasedSlider": () => (/* binding */ ImageBasedSlider)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var _baseSlider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./baseSlider */ "../../../lts/gui/dist/2D/controls/sliders/baseSlider.js");
/* harmony import */ var _measure__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../measure */ "../../../lts/gui/dist/2D/measure.js");
/* harmony import */ var _image__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../image */ "../../../lts/gui/dist/2D/controls/image.js");
/* harmony import */ var core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core/Misc/decorators */ "core/Misc/observable");
/* harmony import */ var core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_4__);






/**
 * Class used to create slider controls based on images
 */
var ImageBasedSlider = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(ImageBasedSlider, _super);
    /**
     * Creates a new ImageBasedSlider
     * @param name defines the control name
     */
    function ImageBasedSlider(name) {
        var _this = _super.call(this, name) || this;
        _this.name = name;
        _this._tempMeasure = new _measure__WEBPACK_IMPORTED_MODULE_2__.Measure(0, 0, 0, 0);
        return _this;
    }
    Object.defineProperty(ImageBasedSlider.prototype, "displayThumb", {
        get: function () {
            return this._displayThumb && this.thumbImage != null;
        },
        set: function (value) {
            if (this._displayThumb === value) {
                return;
            }
            this._displayThumb = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ImageBasedSlider.prototype, "backgroundImage", {
        /**
         * Gets or sets the image used to render the background
         */
        get: function () {
            return this._backgroundImage;
        },
        set: function (value) {
            var _this = this;
            if (this._backgroundImage === value) {
                return;
            }
            this._backgroundImage = value;
            if (value && !value.isLoaded) {
                value.onImageLoadedObservable.addOnce(function () { return _this._markAsDirty(); });
            }
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ImageBasedSlider.prototype, "valueBarImage", {
        /**
         * Gets or sets the image used to render the value bar
         */
        get: function () {
            return this._valueBarImage;
        },
        set: function (value) {
            var _this = this;
            if (this._valueBarImage === value) {
                return;
            }
            this._valueBarImage = value;
            if (value && !value.isLoaded) {
                value.onImageLoadedObservable.addOnce(function () { return _this._markAsDirty(); });
            }
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ImageBasedSlider.prototype, "thumbImage", {
        /**
         * Gets or sets the image used to render the thumb
         */
        get: function () {
            return this._thumbImage;
        },
        set: function (value) {
            var _this = this;
            if (this._thumbImage === value) {
                return;
            }
            this._thumbImage = value;
            if (value && !value.isLoaded) {
                value.onImageLoadedObservable.addOnce(function () { return _this._markAsDirty(); });
            }
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    ImageBasedSlider.prototype._getTypeName = function () {
        return "ImageBasedSlider";
    };
    ImageBasedSlider.prototype._draw = function (context) {
        context.save();
        this._applyStates(context);
        this._prepareRenderingData("rectangle");
        var thumbPosition = this._getThumbPosition();
        var left = this._renderLeft;
        var top = this._renderTop;
        var width = this._renderWidth;
        var height = this._renderHeight;
        // Background
        if (this._backgroundImage) {
            this._tempMeasure.copyFromFloats(left, top, width, height);
            if (this.isThumbClamped && this.displayThumb) {
                if (this.isVertical) {
                    this._tempMeasure.height += this._effectiveThumbThickness;
                }
                else {
                    this._tempMeasure.width += this._effectiveThumbThickness;
                }
            }
            this._backgroundImage._currentMeasure.copyFrom(this._tempMeasure);
            this._backgroundImage._draw(context);
        }
        // Bar
        if (this._valueBarImage) {
            if (this.isVertical) {
                if (this.isThumbClamped && this.displayThumb) {
                    this._tempMeasure.copyFromFloats(left, top + thumbPosition, width, height - thumbPosition + this._effectiveThumbThickness);
                }
                else {
                    this._tempMeasure.copyFromFloats(left, top + thumbPosition, width, height - thumbPosition);
                }
            }
            else {
                if (this.isThumbClamped && this.displayThumb) {
                    this._tempMeasure.copyFromFloats(left, top, thumbPosition + this._effectiveThumbThickness / 2, height);
                }
                else {
                    this._tempMeasure.copyFromFloats(left, top, thumbPosition, height);
                }
            }
            this._valueBarImage._currentMeasure.copyFrom(this._tempMeasure);
            this._valueBarImage._draw(context);
        }
        // Thumb
        if (this.displayThumb) {
            if (this.isVertical) {
                this._tempMeasure.copyFromFloats(left - this._effectiveBarOffset, this._currentMeasure.top + thumbPosition, this._currentMeasure.width, this._effectiveThumbThickness);
            }
            else {
                this._tempMeasure.copyFromFloats(this._currentMeasure.left + thumbPosition, this._currentMeasure.top, this._effectiveThumbThickness, this._currentMeasure.height);
            }
            this._thumbImage._currentMeasure.copyFrom(this._tempMeasure);
            this._thumbImage._draw(context);
        }
        context.restore();
    };
    /**
     * Serializes the current control
     * @param serializationObject defined the JSON serialized object
     */
    ImageBasedSlider.prototype.serialize = function (serializationObject) {
        _super.prototype.serialize.call(this, serializationObject);
        var backgroundImage = {};
        var thumbImage = {};
        var valueBarImage = {};
        this.backgroundImage.serialize(backgroundImage);
        this.thumbImage.serialize(thumbImage);
        this.valueBarImage.serialize(valueBarImage);
        serializationObject.backgroundImage = backgroundImage;
        serializationObject.thumbImage = thumbImage;
        serializationObject.valueBarImage = valueBarImage;
    };
    /**
     * @param serializedObject
     * @param host
     * @hidden
     */
    ImageBasedSlider.prototype._parseFromContent = function (serializedObject, host) {
        _super.prototype._parseFromContent.call(this, serializedObject, host);
        this.backgroundImage = _image__WEBPACK_IMPORTED_MODULE_3__.Image.Parse(serializedObject.backgroundImage, host);
        this.thumbImage = _image__WEBPACK_IMPORTED_MODULE_3__.Image.Parse(serializedObject.thumbImage, host);
        this.valueBarImage = _image__WEBPACK_IMPORTED_MODULE_3__.Image.Parse(serializedObject.valueBarImage, host);
    };
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_4__.serialize)()
    ], ImageBasedSlider.prototype, "displayThumb", null);
    return ImageBasedSlider;
}(_baseSlider__WEBPACK_IMPORTED_MODULE_1__.BaseSlider));

(0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_4__.RegisterClass)("BABYLON.GUI.ImageBasedSlider", ImageBasedSlider);


/***/ }),

/***/ "../../../lts/gui/dist/2D/controls/sliders/imageScrollBar.js":
/*!*******************************************************************!*\
  !*** ../../../lts/gui/dist/2D/controls/sliders/imageScrollBar.js ***!
  \*******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "ImageScrollBar": () => (/* binding */ ImageScrollBar)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var _baseSlider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./baseSlider */ "../../../lts/gui/dist/2D/controls/sliders/baseSlider.js");
/* harmony import */ var _measure__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../measure */ "../../../lts/gui/dist/2D/measure.js");
/* harmony import */ var core_Misc_decorators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core/Misc/decorators */ "core/Misc/observable");
/* harmony import */ var core_Misc_decorators__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_3__);




/**
 * Class used to create slider controls
 */
var ImageScrollBar = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(ImageScrollBar, _super);
    /**
     * Creates a new ImageScrollBar
     * @param name defines the control name
     */
    function ImageScrollBar(name) {
        var _this = _super.call(this, name) || this;
        _this.name = name;
        _this._thumbLength = 0.5;
        _this._thumbHeight = 1;
        _this._barImageHeight = 1;
        _this._tempMeasure = new _measure__WEBPACK_IMPORTED_MODULE_2__.Measure(0, 0, 0, 0);
        /** Number of 90° rotation to apply on the images when in vertical mode */
        _this.num90RotationInVerticalMode = 1;
        return _this;
    }
    Object.defineProperty(ImageScrollBar.prototype, "backgroundImage", {
        /**
         * Gets or sets the image used to render the background for horizontal bar
         */
        get: function () {
            return this._backgroundBaseImage;
        },
        set: function (value) {
            var _this = this;
            if (this._backgroundBaseImage === value) {
                return;
            }
            this._backgroundBaseImage = value;
            if (this.isVertical && this.num90RotationInVerticalMode !== 0) {
                if (!value.isLoaded) {
                    value.onImageLoadedObservable.addOnce(function () {
                        var rotatedValue = value._rotate90(_this.num90RotationInVerticalMode, true);
                        _this._backgroundImage = rotatedValue;
                        if (!rotatedValue.isLoaded) {
                            rotatedValue.onImageLoadedObservable.addOnce(function () {
                                _this._markAsDirty();
                            });
                        }
                        _this._markAsDirty();
                    });
                }
                else {
                    this._backgroundImage = value._rotate90(this.num90RotationInVerticalMode, true);
                    this._markAsDirty();
                }
            }
            else {
                this._backgroundImage = value;
                if (value && !value.isLoaded) {
                    value.onImageLoadedObservable.addOnce(function () {
                        _this._markAsDirty();
                    });
                }
                this._markAsDirty();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ImageScrollBar.prototype, "thumbImage", {
        /**
         * Gets or sets the image used to render the thumb
         */
        get: function () {
            return this._thumbBaseImage;
        },
        set: function (value) {
            var _this = this;
            if (this._thumbBaseImage === value) {
                return;
            }
            this._thumbBaseImage = value;
            if (this.isVertical && this.num90RotationInVerticalMode !== 0) {
                if (!value.isLoaded) {
                    value.onImageLoadedObservable.addOnce(function () {
                        var rotatedValue = value._rotate90(-_this.num90RotationInVerticalMode, true);
                        _this._thumbImage = rotatedValue;
                        if (!rotatedValue.isLoaded) {
                            rotatedValue.onImageLoadedObservable.addOnce(function () {
                                _this._markAsDirty();
                            });
                        }
                        _this._markAsDirty();
                    });
                }
                else {
                    this._thumbImage = value._rotate90(-this.num90RotationInVerticalMode, true);
                    this._markAsDirty();
                }
            }
            else {
                this._thumbImage = value;
                if (value && !value.isLoaded) {
                    value.onImageLoadedObservable.addOnce(function () {
                        _this._markAsDirty();
                    });
                }
                this._markAsDirty();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ImageScrollBar.prototype, "thumbLength", {
        /**
         * Gets or sets the length of the thumb
         */
        get: function () {
            return this._thumbLength;
        },
        set: function (value) {
            if (this._thumbLength === value) {
                return;
            }
            this._thumbLength = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ImageScrollBar.prototype, "thumbHeight", {
        /**
         * Gets or sets the height of the thumb
         */
        get: function () {
            return this._thumbHeight;
        },
        set: function (value) {
            if (this._thumbLength === value) {
                return;
            }
            this._thumbHeight = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ImageScrollBar.prototype, "barImageHeight", {
        /**
         * Gets or sets the height of the bar image
         */
        get: function () {
            return this._barImageHeight;
        },
        set: function (value) {
            if (this._barImageHeight === value) {
                return;
            }
            this._barImageHeight = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    ImageScrollBar.prototype._getTypeName = function () {
        return "ImageScrollBar";
    };
    ImageScrollBar.prototype._getThumbThickness = function () {
        var thumbThickness = 0;
        if (this._thumbWidth.isPixel) {
            thumbThickness = this._thumbWidth.getValue(this._host);
        }
        else {
            thumbThickness = this._backgroundBoxThickness * this._thumbWidth.getValue(this._host);
        }
        return thumbThickness;
    };
    ImageScrollBar.prototype._draw = function (context) {
        context.save();
        this._applyStates(context);
        this._prepareRenderingData("rectangle");
        var thumbPosition = this._getThumbPosition();
        var left = this._renderLeft;
        var top = this._renderTop;
        var width = this._renderWidth;
        var height = this._renderHeight;
        // Background
        if (this._backgroundImage) {
            this._tempMeasure.copyFromFloats(left, top, width, height);
            if (this.isVertical) {
                this._tempMeasure.copyFromFloats(left + width * (1 - this._barImageHeight) * 0.5, this._currentMeasure.top, width * this._barImageHeight, height);
                this._tempMeasure.height += this._effectiveThumbThickness;
                this._backgroundImage._currentMeasure.copyFrom(this._tempMeasure);
            }
            else {
                this._tempMeasure.copyFromFloats(this._currentMeasure.left, top + height * (1 - this._barImageHeight) * 0.5, width, height * this._barImageHeight);
                this._tempMeasure.width += this._effectiveThumbThickness;
                this._backgroundImage._currentMeasure.copyFrom(this._tempMeasure);
            }
            this._backgroundImage._draw(context);
        }
        // Thumb
        if (this.isVertical) {
            this._tempMeasure.copyFromFloats(left - this._effectiveBarOffset + this._currentMeasure.width * (1 - this._thumbHeight) * 0.5, this._currentMeasure.top + thumbPosition, this._currentMeasure.width * this._thumbHeight, this._effectiveThumbThickness);
        }
        else {
            this._tempMeasure.copyFromFloats(this._currentMeasure.left + thumbPosition, this._currentMeasure.top + this._currentMeasure.height * (1 - this._thumbHeight) * 0.5, this._effectiveThumbThickness, this._currentMeasure.height * this._thumbHeight);
        }
        if (this._thumbImage) {
            this._thumbImage._currentMeasure.copyFrom(this._tempMeasure);
            this._thumbImage._draw(context);
        }
        context.restore();
    };
    /**
     * @param x
     * @param y
     * @hidden
     */
    ImageScrollBar.prototype._updateValueFromPointer = function (x, y) {
        if (this.rotation != 0) {
            this._invertTransformMatrix.transformCoordinates(x, y, this._transformedPosition);
            x = this._transformedPosition.x;
            y = this._transformedPosition.y;
        }
        if (this._first) {
            this._first = false;
            this._originX = x;
            this._originY = y;
            // Check if move is required
            if (x < this._tempMeasure.left ||
                x > this._tempMeasure.left + this._tempMeasure.width ||
                y < this._tempMeasure.top ||
                y > this._tempMeasure.top + this._tempMeasure.height) {
                if (this.isVertical) {
                    this.value = this.minimum + (1 - (y - this._currentMeasure.top) / this._currentMeasure.height) * (this.maximum - this.minimum);
                }
                else {
                    this.value = this.minimum + ((x - this._currentMeasure.left) / this._currentMeasure.width) * (this.maximum - this.minimum);
                }
            }
        }
        // Delta mode
        var delta = 0;
        if (this.isVertical) {
            delta = -((y - this._originY) / (this._currentMeasure.height - this._effectiveThumbThickness));
        }
        else {
            delta = (x - this._originX) / (this._currentMeasure.width - this._effectiveThumbThickness);
        }
        this.value += delta * (this.maximum - this.minimum);
        this._originX = x;
        this._originY = y;
    };
    ImageScrollBar.prototype._onPointerDown = function (target, coordinates, pointerId, buttonIndex, pi) {
        this._first = true;
        return _super.prototype._onPointerDown.call(this, target, coordinates, pointerId, buttonIndex, pi);
    };
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_3__.serialize)()
    ], ImageScrollBar.prototype, "num90RotationInVerticalMode", void 0);
    return ImageScrollBar;
}(_baseSlider__WEBPACK_IMPORTED_MODULE_1__.BaseSlider));



/***/ }),

/***/ "../../../lts/gui/dist/2D/controls/sliders/scrollBar.js":
/*!**************************************************************!*\
  !*** ../../../lts/gui/dist/2D/controls/sliders/scrollBar.js ***!
  \**************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "ScrollBar": () => (/* binding */ ScrollBar)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var _baseSlider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./baseSlider */ "../../../lts/gui/dist/2D/controls/sliders/baseSlider.js");
/* harmony import */ var _measure__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../measure */ "../../../lts/gui/dist/2D/measure.js");
/* harmony import */ var core_Misc_decorators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core/Misc/decorators */ "core/Misc/observable");
/* harmony import */ var core_Misc_decorators__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_3__);




/**
 * Class used to create slider controls
 */
var ScrollBar = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(ScrollBar, _super);
    /**
     * Creates a new Slider
     * @param name defines the control name
     */
    function ScrollBar(name) {
        var _this = _super.call(this, name) || this;
        _this.name = name;
        _this._background = "black";
        _this._borderColor = "white";
        _this._tempMeasure = new _measure__WEBPACK_IMPORTED_MODULE_2__.Measure(0, 0, 0, 0);
        return _this;
    }
    Object.defineProperty(ScrollBar.prototype, "borderColor", {
        /** Gets or sets border color */
        get: function () {
            return this._borderColor;
        },
        set: function (value) {
            if (this._borderColor === value) {
                return;
            }
            this._borderColor = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ScrollBar.prototype, "background", {
        /** Gets or sets background color */
        get: function () {
            return this._background;
        },
        set: function (value) {
            if (this._background === value) {
                return;
            }
            this._background = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    ScrollBar.prototype._getTypeName = function () {
        return "Scrollbar";
    };
    ScrollBar.prototype._getThumbThickness = function () {
        var thumbThickness = 0;
        if (this._thumbWidth.isPixel) {
            thumbThickness = this._thumbWidth.getValue(this._host);
        }
        else {
            thumbThickness = this._backgroundBoxThickness * this._thumbWidth.getValue(this._host);
        }
        return thumbThickness;
    };
    ScrollBar.prototype._draw = function (context) {
        context.save();
        this._applyStates(context);
        this._prepareRenderingData("rectangle");
        var left = this._renderLeft;
        var thumbPosition = this._getThumbPosition();
        context.fillStyle = this._background;
        context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);
        // Value bar
        context.fillStyle = this.color;
        // Thumb
        if (this.isVertical) {
            this._tempMeasure.left = left - this._effectiveBarOffset;
            this._tempMeasure.top = this._currentMeasure.top + thumbPosition;
            this._tempMeasure.width = this._currentMeasure.width;
            this._tempMeasure.height = this._effectiveThumbThickness;
        }
        else {
            this._tempMeasure.left = this._currentMeasure.left + thumbPosition;
            this._tempMeasure.top = this._currentMeasure.top;
            this._tempMeasure.width = this._effectiveThumbThickness;
            this._tempMeasure.height = this._currentMeasure.height;
        }
        context.fillRect(this._tempMeasure.left, this._tempMeasure.top, this._tempMeasure.width, this._tempMeasure.height);
        context.restore();
    };
    /**
     * @param x
     * @param y
     * @hidden
     */
    ScrollBar.prototype._updateValueFromPointer = function (x, y) {
        if (this.rotation != 0) {
            this._invertTransformMatrix.transformCoordinates(x, y, this._transformedPosition);
            x = this._transformedPosition.x;
            y = this._transformedPosition.y;
        }
        if (this._first) {
            this._first = false;
            this._originX = x;
            this._originY = y;
            // Check if move is required
            if (x < this._tempMeasure.left ||
                x > this._tempMeasure.left + this._tempMeasure.width ||
                y < this._tempMeasure.top ||
                y > this._tempMeasure.top + this._tempMeasure.height) {
                if (this.isVertical) {
                    this.value = this.minimum + (1 - (y - this._currentMeasure.top) / this._currentMeasure.height) * (this.maximum - this.minimum);
                }
                else {
                    this.value = this.minimum + ((x - this._currentMeasure.left) / this._currentMeasure.width) * (this.maximum - this.minimum);
                }
            }
        }
        // Delta mode
        var delta = 0;
        if (this.isVertical) {
            delta = -((y - this._originY) / (this._currentMeasure.height - this._effectiveThumbThickness));
        }
        else {
            delta = (x - this._originX) / (this._currentMeasure.width - this._effectiveThumbThickness);
        }
        this.value += delta * (this.maximum - this.minimum);
        this._originX = x;
        this._originY = y;
    };
    ScrollBar.prototype._onPointerDown = function (target, coordinates, pointerId, buttonIndex, pi) {
        this._first = true;
        return _super.prototype._onPointerDown.call(this, target, coordinates, pointerId, buttonIndex, pi);
    };
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_3__.serialize)()
    ], ScrollBar.prototype, "borderColor", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_3__.serialize)()
    ], ScrollBar.prototype, "background", null);
    return ScrollBar;
}(_baseSlider__WEBPACK_IMPORTED_MODULE_1__.BaseSlider));



/***/ }),

/***/ "../../../lts/gui/dist/2D/controls/sliders/slider.js":
/*!***********************************************************!*\
  !*** ../../../lts/gui/dist/2D/controls/sliders/slider.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Slider": () => (/* binding */ Slider)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var _baseSlider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./baseSlider */ "../../../lts/gui/dist/2D/controls/sliders/baseSlider.js");
/* harmony import */ var core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core/Misc/decorators */ "core/Misc/observable");
/* harmony import */ var core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2__);




/**
 * Class used to create slider controls
 */
var Slider = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(Slider, _super);
    /**
     * Creates a new Slider
     * @param name defines the control name
     */
    function Slider(name) {
        var _this = _super.call(this, name) || this;
        _this.name = name;
        _this._background = "black";
        _this._borderColor = "white";
        _this._thumbColor = "";
        _this._isThumbCircle = false;
        _this._displayValueBar = true;
        return _this;
    }
    Object.defineProperty(Slider.prototype, "displayValueBar", {
        /** Gets or sets a boolean indicating if the value bar must be rendered */
        get: function () {
            return this._displayValueBar;
        },
        set: function (value) {
            if (this._displayValueBar === value) {
                return;
            }
            this._displayValueBar = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Slider.prototype, "borderColor", {
        /** Gets or sets border color */
        get: function () {
            return this._borderColor;
        },
        set: function (value) {
            if (this._borderColor === value) {
                return;
            }
            this._borderColor = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Slider.prototype, "background", {
        /** Gets or sets background color */
        get: function () {
            return this._background;
        },
        set: function (value) {
            if (this._background === value) {
                return;
            }
            this._background = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Slider.prototype, "thumbColor", {
        /** Gets or sets thumb's color */
        get: function () {
            return this._thumbColor;
        },
        set: function (value) {
            if (this._thumbColor === value) {
                return;
            }
            this._thumbColor = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Slider.prototype, "isThumbCircle", {
        /** Gets or sets a boolean indicating if the thumb should be round or square */
        get: function () {
            return this._isThumbCircle;
        },
        set: function (value) {
            if (this._isThumbCircle === value) {
                return;
            }
            this._isThumbCircle = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Slider.prototype._getTypeName = function () {
        return "Slider";
    };
    Slider.prototype._draw = function (context) {
        context.save();
        this._applyStates(context);
        this._prepareRenderingData(this.isThumbCircle ? "circle" : "rectangle");
        var left = this._renderLeft;
        var top = this._renderTop;
        var width = this._renderWidth;
        var height = this._renderHeight;
        var radius = 0;
        if (this.isThumbClamped && this.isThumbCircle) {
            if (this.isVertical) {
                top += this._effectiveThumbThickness / 2;
            }
            else {
                left += this._effectiveThumbThickness / 2;
            }
            radius = this._backgroundBoxThickness / 2;
        }
        else {
            radius = (this._effectiveThumbThickness - this._effectiveBarOffset) / 2;
        }
        if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
            context.shadowColor = this.shadowColor;
            context.shadowBlur = this.shadowBlur;
            context.shadowOffsetX = this.shadowOffsetX;
            context.shadowOffsetY = this.shadowOffsetY;
        }
        var thumbPosition = this._getThumbPosition();
        context.fillStyle = this._background;
        if (this.isVertical) {
            if (this.isThumbClamped) {
                if (this.isThumbCircle) {
                    context.beginPath();
                    context.arc(left + this._backgroundBoxThickness / 2, top, radius, Math.PI, 2 * Math.PI);
                    context.fill();
                    context.fillRect(left, top, width, height);
                }
                else {
                    context.fillRect(left, top, width, height + this._effectiveThumbThickness);
                }
            }
            else {
                context.fillRect(left, top, width, height);
            }
        }
        else {
            if (this.isThumbClamped) {
                if (this.isThumbCircle) {
                    context.beginPath();
                    context.arc(left + this._backgroundBoxLength, top + this._backgroundBoxThickness / 2, radius, 0, 2 * Math.PI);
                    context.fill();
                    context.fillRect(left, top, width, height);
                }
                else {
                    context.fillRect(left, top, width + this._effectiveThumbThickness, height);
                }
            }
            else {
                context.fillRect(left, top, width, height);
            }
        }
        if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
            context.shadowBlur = 0;
            context.shadowOffsetX = 0;
            context.shadowOffsetY = 0;
        }
        // Value bar
        context.fillStyle = this.color;
        if (this._displayValueBar) {
            if (this.isVertical) {
                if (this.isThumbClamped) {
                    if (this.isThumbCircle) {
                        context.beginPath();
                        context.arc(left + this._backgroundBoxThickness / 2, top + this._backgroundBoxLength, radius, 0, 2 * Math.PI);
                        context.fill();
                        context.fillRect(left, top + thumbPosition, width, height - thumbPosition);
                    }
                    else {
                        context.fillRect(left, top + thumbPosition, width, height - thumbPosition + this._effectiveThumbThickness);
                    }
                }
                else {
                    context.fillRect(left, top + thumbPosition, width, height - thumbPosition);
                }
            }
            else {
                if (this.isThumbClamped) {
                    if (this.isThumbCircle) {
                        context.beginPath();
                        context.arc(left, top + this._backgroundBoxThickness / 2, radius, 0, 2 * Math.PI);
                        context.fill();
                        context.fillRect(left, top, thumbPosition, height);
                    }
                    else {
                        context.fillRect(left, top, thumbPosition, height);
                    }
                }
                else {
                    context.fillRect(left, top, thumbPosition, height);
                }
            }
        }
        // Thumb
        context.fillStyle = this._thumbColor || this.color;
        if (this.displayThumb) {
            if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
                context.shadowColor = this.shadowColor;
                context.shadowBlur = this.shadowBlur;
                context.shadowOffsetX = this.shadowOffsetX;
                context.shadowOffsetY = this.shadowOffsetY;
            }
            if (this._isThumbCircle) {
                context.beginPath();
                if (this.isVertical) {
                    context.arc(left + this._backgroundBoxThickness / 2, top + thumbPosition, radius, 0, 2 * Math.PI);
                }
                else {
                    context.arc(left + thumbPosition, top + this._backgroundBoxThickness / 2, radius, 0, 2 * Math.PI);
                }
                context.fill();
                if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
                    context.shadowBlur = 0;
                    context.shadowOffsetX = 0;
                    context.shadowOffsetY = 0;
                }
                context.strokeStyle = this._borderColor;
                context.stroke();
            }
            else {
                if (this.isVertical) {
                    context.fillRect(left - this._effectiveBarOffset, this._currentMeasure.top + thumbPosition, this._currentMeasure.width, this._effectiveThumbThickness);
                }
                else {
                    context.fillRect(this._currentMeasure.left + thumbPosition, this._currentMeasure.top, this._effectiveThumbThickness, this._currentMeasure.height);
                }
                if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
                    context.shadowBlur = 0;
                    context.shadowOffsetX = 0;
                    context.shadowOffsetY = 0;
                }
                context.strokeStyle = this._borderColor;
                if (this.isVertical) {
                    context.strokeRect(left - this._effectiveBarOffset, this._currentMeasure.top + thumbPosition, this._currentMeasure.width, this._effectiveThumbThickness);
                }
                else {
                    context.strokeRect(this._currentMeasure.left + thumbPosition, this._currentMeasure.top, this._effectiveThumbThickness, this._currentMeasure.height);
                }
            }
        }
        context.restore();
    };
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2__.serialize)()
    ], Slider.prototype, "displayValueBar", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2__.serialize)()
    ], Slider.prototype, "borderColor", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2__.serialize)()
    ], Slider.prototype, "background", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2__.serialize)()
    ], Slider.prototype, "thumbColor", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2__.serialize)()
    ], Slider.prototype, "isThumbCircle", null);
    return Slider;
}(_baseSlider__WEBPACK_IMPORTED_MODULE_1__.BaseSlider));

(0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_2__.RegisterClass)("BABYLON.GUI.Slider", Slider);


/***/ }),

/***/ "../../../lts/gui/dist/2D/controls/stackPanel.js":
/*!*******************************************************!*\
  !*** ../../../lts/gui/dist/2D/controls/stackPanel.js ***!
  \*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "StackPanel": () => (/* binding */ StackPanel)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Misc/decorators */ "core/Misc/observable");
/* harmony import */ var core_Misc_tools__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _container__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./container */ "../../../lts/gui/dist/2D/controls/container.js");
/* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./control */ "../../../lts/gui/dist/2D/controls/control.js");






/**
 * Class used to create a 2D stack panel container
 */
var StackPanel = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(StackPanel, _super);
    /**
     * Creates a new StackPanel
     * @param name defines control name
     */
    function StackPanel(name) {
        var _this = _super.call(this, name) || this;
        _this.name = name;
        _this._isVertical = true;
        _this._manualWidth = false;
        _this._manualHeight = false;
        _this._doNotTrackManualChanges = false;
        _this._spacing = 0;
        /**
         * Gets or sets a boolean indicating that layout warnings should be ignored
         */
        _this.ignoreLayoutWarnings = false;
        return _this;
    }
    Object.defineProperty(StackPanel.prototype, "isVertical", {
        /** Gets or sets a boolean indicating if the stack panel is vertical or horizontal*/
        get: function () {
            return this._isVertical;
        },
        set: function (value) {
            if (this._isVertical === value) {
                return;
            }
            this._isVertical = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(StackPanel.prototype, "spacing", {
        /**
         * Gets or sets the spacing (in pixels) between each child.
         */
        get: function () {
            return this._spacing;
        },
        set: function (value) {
            if (this._spacing === value) {
                return;
            }
            this._spacing = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(StackPanel.prototype, "width", {
        get: function () {
            return this._width.toString(this._host);
        },
        /**
         * Gets or sets panel width.
         * This value should not be set when in horizontal mode as it will be computed automatically
         */
        set: function (value) {
            if (!this._doNotTrackManualChanges) {
                this._manualWidth = true;
            }
            if (this._width.toString(this._host) === value) {
                return;
            }
            if (this._width.fromString(value)) {
                this._markAsDirty();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(StackPanel.prototype, "height", {
        get: function () {
            return this._height.toString(this._host);
        },
        /**
         * Gets or sets panel height.
         * This value should not be set when in vertical mode as it will be computed automatically
         */
        set: function (value) {
            if (!this._doNotTrackManualChanges) {
                this._manualHeight = true;
            }
            if (this._height.toString(this._host) === value) {
                return;
            }
            if (this._height.fromString(value)) {
                this._markAsDirty();
            }
        },
        enumerable: false,
        configurable: true
    });
    StackPanel.prototype._getTypeName = function () {
        return "StackPanel";
    };
    /**
     * @param parentMeasure
     * @param context
     * @hidden
     */
    StackPanel.prototype._preMeasure = function (parentMeasure, context) {
        for (var _i = 0, _a = this._children; _i < _a.length; _i++) {
            var child = _a[_i];
            if (this._isVertical) {
                child.verticalAlignment = _control__WEBPACK_IMPORTED_MODULE_3__.Control.VERTICAL_ALIGNMENT_TOP;
            }
            else {
                child.horizontalAlignment = _control__WEBPACK_IMPORTED_MODULE_3__.Control.HORIZONTAL_ALIGNMENT_LEFT;
            }
        }
        _super.prototype._preMeasure.call(this, parentMeasure, context);
    };
    StackPanel.prototype._additionalProcessing = function (parentMeasure, context) {
        _super.prototype._additionalProcessing.call(this, parentMeasure, context);
        this._measureForChildren.copyFrom(parentMeasure);
        this._measureForChildren.left = this._currentMeasure.left;
        this._measureForChildren.top = this._currentMeasure.top;
        if (!this.isVertical || this._manualWidth) {
            this._measureForChildren.width = this._currentMeasure.width;
        }
        if (this.isVertical || this._manualHeight) {
            this._measureForChildren.height = this._currentMeasure.height;
        }
    };
    StackPanel.prototype._postMeasure = function () {
        var stackWidth = 0;
        var stackHeight = 0;
        var childrenCount = this._children.length;
        for (var index = 0; index < childrenCount; index++) {
            var child = this._children[index];
            if (!child.isVisible || child.notRenderable) {
                continue;
            }
            if (this._isVertical) {
                if (child.top !== stackHeight + "px") {
                    child.top = stackHeight + "px";
                    this._rebuildLayout = true;
                    child._top.ignoreAdaptiveScaling = true;
                }
                if (child._height.isPercentage && !child._automaticSize) {
                    if (!this.ignoreLayoutWarnings) {
                        core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.Tools.Warn("Control (Name:".concat(child.name, ", UniqueId:").concat(child.uniqueId, ") is using height in percentage mode inside a vertical StackPanel"));
                    }
                }
                else {
                    stackHeight += child._currentMeasure.height + child._paddingTopInPixels + child._paddingBottomInPixels + (index < childrenCount - 1 ? this._spacing : 0);
                }
            }
            else {
                if (child.left !== stackWidth + "px") {
                    child.left = stackWidth + "px";
                    this._rebuildLayout = true;
                    child._left.ignoreAdaptiveScaling = true;
                }
                if (child._width.isPercentage && !child._automaticSize) {
                    if (!this.ignoreLayoutWarnings) {
                        core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.Tools.Warn("Control (Name:".concat(child.name, ", UniqueId:").concat(child.uniqueId, ") is using width in percentage mode inside a horizontal StackPanel"));
                    }
                }
                else {
                    stackWidth += child._currentMeasure.width + child._paddingLeftInPixels + child._paddingRightInPixels + (index < childrenCount - 1 ? this._spacing : 0);
                }
            }
        }
        stackWidth += this._paddingLeftInPixels + this._paddingRightInPixels;
        stackHeight += this._paddingTopInPixels + this._paddingBottomInPixels;
        this._doNotTrackManualChanges = true;
        // Let stack panel width or height default to stackHeight and stackWidth if dimensions are not specified.
        // User can now define their own height and width for stack panel.
        var panelWidthChanged = false;
        var panelHeightChanged = false;
        if (!this._manualHeight && this._isVertical) {
            // do not specify height if strictly defined by user
            var previousHeight = this.height;
            this.height = stackHeight + "px";
            panelHeightChanged = previousHeight !== this.height || !this._height.ignoreAdaptiveScaling;
        }
        if (!this._manualWidth && !this._isVertical) {
            // do not specify width if strictly defined by user
            var previousWidth = this.width;
            this.width = stackWidth + "px";
            panelWidthChanged = previousWidth !== this.width || !this._width.ignoreAdaptiveScaling;
        }
        if (panelHeightChanged) {
            this._height.ignoreAdaptiveScaling = true;
        }
        if (panelWidthChanged) {
            this._width.ignoreAdaptiveScaling = true;
        }
        this._doNotTrackManualChanges = false;
        if (panelWidthChanged || panelHeightChanged) {
            this._rebuildLayout = true;
        }
        _super.prototype._postMeasure.call(this);
    };
    /**
     * Serializes the current control
     * @param serializationObject defined the JSON serialized object
     */
    StackPanel.prototype.serialize = function (serializationObject) {
        _super.prototype.serialize.call(this, serializationObject);
        serializationObject.manualWidth = this._manualWidth;
        serializationObject.manualHeight = this._manualHeight;
    };
    /**
     * @param serializedObject
     * @param host
     * @hidden
     */
    StackPanel.prototype._parseFromContent = function (serializedObject, host) {
        this._manualWidth = serializedObject.manualWidth;
        this._manualHeight = serializedObject.manualHeight;
        _super.prototype._parseFromContent.call(this, serializedObject, host);
    };
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], StackPanel.prototype, "ignoreLayoutWarnings", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], StackPanel.prototype, "isVertical", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], StackPanel.prototype, "spacing", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], StackPanel.prototype, "width", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], StackPanel.prototype, "height", null);
    return StackPanel;
}(_container__WEBPACK_IMPORTED_MODULE_2__.Container));

(0,core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.RegisterClass)("BABYLON.GUI.StackPanel", StackPanel);


/***/ }),

/***/ "../../../lts/gui/dist/2D/controls/statics.js":
/*!****************************************************!*\
  !*** ../../../lts/gui/dist/2D/controls/statics.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "name": () => (/* binding */ name)
/* harmony export */ });
/* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./control */ "../../../lts/gui/dist/2D/controls/control.js");
/* harmony import */ var _stackPanel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./stackPanel */ "../../../lts/gui/dist/2D/controls/stackPanel.js");
/* harmony import */ var _textBlock__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./textBlock */ "../../../lts/gui/dist/2D/controls/textBlock.js");



/**
 * Forcing an export so that this code will execute
 * @hidden
 */
var name = "Statics";

/**
 * Creates a stack panel that can be used to render headers
 * @param control defines the control to associate with the header
 * @param text defines the text of the header
 * @param size defines the size of the header
 * @param options defines options used to configure the header
 * @param options.isHorizontal
 * @param options.controlFirst
 * @returns a new StackPanel
 */
_control__WEBPACK_IMPORTED_MODULE_0__.Control.AddHeader = function (control, text, size, options) {
    var panel = new _stackPanel__WEBPACK_IMPORTED_MODULE_1__.StackPanel("panel");
    var isHorizontal = options ? options.isHorizontal : true;
    var controlFirst = options ? options.controlFirst : true;
    panel.isVertical = !isHorizontal;
    var header = new _textBlock__WEBPACK_IMPORTED_MODULE_2__.TextBlock("header");
    header.text = text;
    header.textHorizontalAlignment = _control__WEBPACK_IMPORTED_MODULE_0__.Control.HORIZONTAL_ALIGNMENT_LEFT;
    if (isHorizontal) {
        header.width = size;
    }
    else {
        header.height = size;
    }
    if (controlFirst) {
        panel.addControl(control);
        panel.addControl(header);
        header.paddingLeft = "5px";
    }
    else {
        panel.addControl(header);
        panel.addControl(control);
        header.paddingRight = "5px";
    }
    header.shadowBlur = control.shadowBlur;
    header.shadowColor = control.shadowColor;
    header.shadowOffsetX = control.shadowOffsetX;
    header.shadowOffsetY = control.shadowOffsetY;
    return panel;
};


/***/ }),

/***/ "../../../lts/gui/dist/2D/controls/textBlock.js":
/*!******************************************************!*\
  !*** ../../../lts/gui/dist/2D/controls/textBlock.js ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "TextBlock": () => (/* binding */ TextBlock),
/* harmony export */   "TextWrapping": () => (/* binding */ TextWrapping)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Engines/engineStore */ "core/Misc/observable");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _valueAndUnit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../valueAndUnit */ "../../../lts/gui/dist/2D/valueAndUnit.js");
/* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./control */ "../../../lts/gui/dist/2D/controls/control.js");







/**
 * Enum that determines the text-wrapping mode to use.
 */
var TextWrapping;
(function (TextWrapping) {
    /**
     * Clip the text when it's larger than Control.width; this is the default mode.
     */
    TextWrapping[TextWrapping["Clip"] = 0] = "Clip";
    /**
     * Wrap the text word-wise, i.e. try to add line-breaks at word boundary to fit within Control.width.
     */
    TextWrapping[TextWrapping["WordWrap"] = 1] = "WordWrap";
    /**
     * Ellipsize the text, i.e. shrink with trailing … when text is larger than Control.width.
     */
    TextWrapping[TextWrapping["Ellipsis"] = 2] = "Ellipsis";
    /**
     * Wrap the text word-wise and clip the text when the text's height is larger than the Control.height, and shrink the last line with trailing … .
     */
    TextWrapping[TextWrapping["WordWrapEllipsis"] = 3] = "WordWrapEllipsis";
})(TextWrapping || (TextWrapping = {}));
/**
 * Class used to create text block control
 */
var TextBlock = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(TextBlock, _super);
    /**
     * Creates a new TextBlock object
     * @param name defines the name of the control
     * @param text defines the text to display (empty string by default)
     */
    function TextBlock(
    /**
     * Defines the name of the control
     */
    name, text) {
        if (text === void 0) { text = ""; }
        var _this = _super.call(this, name) || this;
        _this.name = name;
        _this._text = "";
        _this._textWrapping = TextWrapping.Clip;
        _this._textHorizontalAlignment = _control__WEBPACK_IMPORTED_MODULE_3__.Control.HORIZONTAL_ALIGNMENT_CENTER;
        _this._textVerticalAlignment = _control__WEBPACK_IMPORTED_MODULE_3__.Control.VERTICAL_ALIGNMENT_CENTER;
        _this._resizeToFit = false;
        _this._lineSpacing = new _valueAndUnit__WEBPACK_IMPORTED_MODULE_2__.ValueAndUnit(0);
        _this._outlineWidth = 0;
        _this._outlineColor = "white";
        _this._underline = false;
        _this._lineThrough = false;
        /**
         * An event triggered after the text is changed
         */
        _this.onTextChangedObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        /**
         * An event triggered after the text was broken up into lines
         */
        _this.onLinesReadyObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        _this.text = text;
        return _this;
    }
    Object.defineProperty(TextBlock.prototype, "lines", {
        /**
         * Return the line list (you may need to use the onLinesReadyObservable to make sure the list is ready)
         */
        get: function () {
            return this._lines;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(TextBlock.prototype, "resizeToFit", {
        /**
         * Gets or sets an boolean indicating that the TextBlock will be resized to fit container
         */
        get: function () {
            return this._resizeToFit;
        },
        /**
         * Gets or sets an boolean indicating that the TextBlock will be resized to fit container
         */
        set: function (value) {
            if (this._resizeToFit === value) {
                return;
            }
            this._resizeToFit = value;
            if (this._resizeToFit) {
                this._width.ignoreAdaptiveScaling = true;
                this._height.ignoreAdaptiveScaling = true;
            }
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(TextBlock.prototype, "textWrapping", {
        /**
         * Gets or sets a boolean indicating if text must be wrapped
         */
        get: function () {
            return this._textWrapping;
        },
        /**
         * Gets or sets a boolean indicating if text must be wrapped
         */
        set: function (value) {
            if (this._textWrapping === value) {
                return;
            }
            this._textWrapping = +value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(TextBlock.prototype, "text", {
        /**
         * Gets or sets text to display
         */
        get: function () {
            return this._text;
        },
        /**
         * Gets or sets text to display
         */
        set: function (value) {
            if (this._text === value) {
                return;
            }
            this._text = value + ""; // Making sure it is a text
            this._markAsDirty();
            this.onTextChangedObservable.notifyObservers(this);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(TextBlock.prototype, "textHorizontalAlignment", {
        /**
         * Gets or sets text horizontal alignment (BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_CENTER by default)
         */
        get: function () {
            return this._textHorizontalAlignment;
        },
        /**
         * Gets or sets text horizontal alignment (BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_CENTER by default)
         */
        set: function (value) {
            if (this._textHorizontalAlignment === value) {
                return;
            }
            this._textHorizontalAlignment = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(TextBlock.prototype, "textVerticalAlignment", {
        /**
         * Gets or sets text vertical alignment (BABYLON.GUI.Control.VERTICAL_ALIGNMENT_CENTER by default)
         */
        get: function () {
            return this._textVerticalAlignment;
        },
        /**
         * Gets or sets text vertical alignment (BABYLON.GUI.Control.VERTICAL_ALIGNMENT_CENTER by default)
         */
        set: function (value) {
            if (this._textVerticalAlignment === value) {
                return;
            }
            this._textVerticalAlignment = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(TextBlock.prototype, "lineSpacing", {
        /**
         * Gets or sets line spacing value
         */
        get: function () {
            return this._lineSpacing.toString(this._host);
        },
        /**
         * Gets or sets line spacing value
         */
        set: function (value) {
            if (this._lineSpacing.fromString(value)) {
                this._markAsDirty();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(TextBlock.prototype, "outlineWidth", {
        /**
         * Gets or sets outlineWidth of the text to display
         */
        get: function () {
            return this._outlineWidth;
        },
        /**
         * Gets or sets outlineWidth of the text to display
         */
        set: function (value) {
            if (this._outlineWidth === value) {
                return;
            }
            this._outlineWidth = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(TextBlock.prototype, "underline", {
        /**
         * Gets or sets a boolean indicating that text must have underline
         */
        get: function () {
            return this._underline;
        },
        /**
         * Gets or sets a boolean indicating that text must have underline
         */
        set: function (value) {
            if (this._underline === value) {
                return;
            }
            this._underline = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(TextBlock.prototype, "lineThrough", {
        /**
         * Gets or sets an boolean indicating that text must be crossed out
         */
        get: function () {
            return this._lineThrough;
        },
        /**
         * Gets or sets an boolean indicating that text must be crossed out
         */
        set: function (value) {
            if (this._lineThrough === value) {
                return;
            }
            this._lineThrough = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(TextBlock.prototype, "outlineColor", {
        /**
         * Gets or sets outlineColor of the text to display
         */
        get: function () {
            return this._outlineColor;
        },
        /**
         * Gets or sets outlineColor of the text to display
         */
        set: function (value) {
            if (this._outlineColor === value) {
                return;
            }
            this._outlineColor = value;
            this._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    TextBlock.prototype._getTypeName = function () {
        return "TextBlock";
    };
    TextBlock.prototype._processMeasures = function (parentMeasure, context) {
        if (!this._fontOffset || this.isDirty) {
            this._fontOffset = _control__WEBPACK_IMPORTED_MODULE_3__.Control._GetFontOffset(context.font);
        }
        _super.prototype._processMeasures.call(this, parentMeasure, context);
        // Prepare lines
        this._lines = this._breakLines(this._currentMeasure.width, this._currentMeasure.height, context);
        this.onLinesReadyObservable.notifyObservers(this);
        var maxLineWidth = 0;
        for (var i = 0; i < this._lines.length; i++) {
            var line = this._lines[i];
            if (line.width > maxLineWidth) {
                maxLineWidth = line.width;
            }
        }
        if (this._resizeToFit) {
            if (this._textWrapping === TextWrapping.Clip) {
                var newWidth = (this._paddingLeftInPixels + this._paddingRightInPixels + maxLineWidth) | 0;
                if (newWidth !== this._width.internalValue) {
                    this._width.updateInPlace(newWidth, _valueAndUnit__WEBPACK_IMPORTED_MODULE_2__.ValueAndUnit.UNITMODE_PIXEL);
                    this._rebuildLayout = true;
                }
            }
            var newHeight = (this._paddingTopInPixels + this._paddingBottomInPixels + this._fontOffset.height * this._lines.length) | 0;
            if (this._lines.length > 0 && this._lineSpacing.internalValue !== 0) {
                var lineSpacing = 0;
                if (this._lineSpacing.isPixel) {
                    lineSpacing = this._lineSpacing.getValue(this._host);
                }
                else {
                    lineSpacing = this._lineSpacing.getValue(this._host) * this._height.getValueInPixel(this._host, this._cachedParentMeasure.height);
                }
                newHeight += (this._lines.length - 1) * lineSpacing;
            }
            if (newHeight !== this._height.internalValue) {
                this._height.updateInPlace(newHeight, _valueAndUnit__WEBPACK_IMPORTED_MODULE_2__.ValueAndUnit.UNITMODE_PIXEL);
                this._rebuildLayout = true;
            }
        }
    };
    TextBlock.prototype._drawText = function (text, textWidth, y, context) {
        var width = this._currentMeasure.width;
        var x = 0;
        switch (this._textHorizontalAlignment) {
            case _control__WEBPACK_IMPORTED_MODULE_3__.Control.HORIZONTAL_ALIGNMENT_LEFT:
                x = 0;
                break;
            case _control__WEBPACK_IMPORTED_MODULE_3__.Control.HORIZONTAL_ALIGNMENT_RIGHT:
                x = width - textWidth;
                break;
            case _control__WEBPACK_IMPORTED_MODULE_3__.Control.HORIZONTAL_ALIGNMENT_CENTER:
                x = (width - textWidth) / 2;
                break;
        }
        if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
            context.shadowColor = this.shadowColor;
            context.shadowBlur = this.shadowBlur;
            context.shadowOffsetX = this.shadowOffsetX;
            context.shadowOffsetY = this.shadowOffsetY;
        }
        if (this.outlineWidth) {
            context.strokeText(text, this._currentMeasure.left + x, y);
        }
        context.fillText(text, this._currentMeasure.left + x, y);
        if (this._underline) {
            context.beginPath();
            context.lineWidth = Math.round(this.fontSizeInPixels * 0.05);
            context.moveTo(this._currentMeasure.left + x, y + 3);
            context.lineTo(this._currentMeasure.left + x + textWidth, y + 3);
            context.stroke();
            context.closePath();
        }
        if (this._lineThrough) {
            context.beginPath();
            context.lineWidth = Math.round(this.fontSizeInPixels * 0.05);
            context.moveTo(this._currentMeasure.left + x, y - this.fontSizeInPixels / 3);
            context.lineTo(this._currentMeasure.left + x + textWidth, y - this.fontSizeInPixels / 3);
            context.stroke();
            context.closePath();
        }
    };
    /**
     * @param context
     * @hidden
     */
    TextBlock.prototype._draw = function (context) {
        context.save();
        this._applyStates(context);
        // Render lines
        this._renderLines(context);
        context.restore();
    };
    TextBlock.prototype._applyStates = function (context) {
        _super.prototype._applyStates.call(this, context);
        if (this.outlineWidth) {
            context.lineWidth = this.outlineWidth;
            context.strokeStyle = this.outlineColor;
            context.lineJoin = "miter";
            context.miterLimit = 2;
        }
    };
    TextBlock.prototype._breakLines = function (refWidth, refHeight, context) {
        var lines = [];
        var _lines = this.text.split("\n");
        if (this._textWrapping === TextWrapping.Ellipsis) {
            for (var _i = 0, _lines_1 = _lines; _i < _lines_1.length; _i++) {
                var _line = _lines_1[_i];
                lines.push(this._parseLineEllipsis(_line, refWidth, context));
            }
        }
        else if (this._textWrapping === TextWrapping.WordWrap) {
            for (var _a = 0, _lines_2 = _lines; _a < _lines_2.length; _a++) {
                var _line = _lines_2[_a];
                lines.push.apply(lines, this._parseLineWordWrap(_line, refWidth, context));
            }
        }
        else if (this._textWrapping === TextWrapping.WordWrapEllipsis) {
            for (var _b = 0, _lines_3 = _lines; _b < _lines_3.length; _b++) {
                var _line = _lines_3[_b];
                lines.push.apply(lines, this._parseLineWordWrapEllipsis(_line, refWidth, refHeight, context));
            }
        }
        else {
            for (var _c = 0, _lines_4 = _lines; _c < _lines_4.length; _c++) {
                var _line = _lines_4[_c];
                lines.push(this._parseLine(_line, context));
            }
        }
        return lines;
    };
    TextBlock.prototype._parseLine = function (line, context) {
        if (line === void 0) { line = ""; }
        return { text: line, width: this._getTextMetricsWidth(context.measureText(line)) };
    };
    //Calculate how many characters approximately we need to remove
    TextBlock.prototype._getCharsToRemove = function (lineWidth, width, lineLength) {
        var diff = lineWidth > width ? lineWidth - width : 0;
        // This isn't exact unless the font is monospaced
        var charWidth = lineWidth / lineLength;
        var removeChars = Math.max(Math.floor(diff / charWidth), 1);
        return removeChars;
    };
    TextBlock.prototype._parseLineEllipsis = function (line, width, context) {
        if (line === void 0) { line = ""; }
        var lineWidth = this._getTextMetricsWidth(context.measureText(line));
        var removeChars = this._getCharsToRemove(lineWidth, width, line.length);
        // unicode support. split('') does not work with unicode!
        // make sure Array.from is available
        var characters = Array.from && Array.from(line);
        if (!characters) {
            // no array.from, use the old method
            while (line.length > 2 && lineWidth > width) {
                line = line.slice(0, -removeChars);
                lineWidth = this._getTextMetricsWidth(context.measureText(line + "…"));
                removeChars = this._getCharsToRemove(lineWidth, width, line.length);
            }
            // Add on the end
            line += "…";
        }
        else {
            while (characters.length && lineWidth > width) {
                characters.splice(characters.length - removeChars, removeChars);
                line = "".concat(characters.join(""), "\u2026");
                lineWidth = this._getTextMetricsWidth(context.measureText(line));
                removeChars = this._getCharsToRemove(lineWidth, width, line.length);
            }
        }
        return { text: line, width: lineWidth };
    };
    TextBlock.prototype._getTextMetricsWidth = function (textMetrics) {
        if (textMetrics.actualBoundingBoxLeft !== undefined) {
            return Math.abs(textMetrics.actualBoundingBoxLeft) + Math.abs(textMetrics.actualBoundingBoxRight);
        }
        return textMetrics.width;
    };
    TextBlock.prototype._parseLineWordWrap = function (line, width, context) {
        if (line === void 0) { line = ""; }
        var lines = [];
        var words = this.wordSplittingFunction ? this.wordSplittingFunction(line) : line.split(" ");
        var lineWidth = this._getTextMetricsWidth(context.measureText(line));
        for (var n = 0; n < words.length; n++) {
            var testLine = n > 0 ? line + " " + words[n] : words[0];
            var testWidth = this._getTextMetricsWidth(context.measureText(testLine));
            if (testWidth > width && n > 0) {
                lines.push({ text: line, width: lineWidth });
                line = words[n];
                lineWidth = this._getTextMetricsWidth(context.measureText(line));
            }
            else {
                lineWidth = testWidth;
                line = testLine;
            }
        }
        lines.push({ text: line, width: lineWidth });
        return lines;
    };
    TextBlock.prototype._parseLineWordWrapEllipsis = function (line, width, height, context) {
        if (line === void 0) { line = ""; }
        var lines = this._parseLineWordWrap(line, width, context);
        for (var n = 1; n <= lines.length; n++) {
            var currentHeight = this._computeHeightForLinesOf(n);
            if (currentHeight > height && n > 1) {
                var lastLine = lines[n - 2];
                var currentLine = lines[n - 1];
                lines[n - 2] = this._parseLineEllipsis("".concat(lastLine.text + currentLine.text), width, context);
                var linesToRemove = lines.length - n + 1;
                for (var i = 0; i < linesToRemove; i++) {
                    lines.pop();
                }
                return lines;
            }
        }
        return lines;
    };
    TextBlock.prototype._renderLines = function (context) {
        var height = this._currentMeasure.height;
        var rootY = 0;
        switch (this._textVerticalAlignment) {
            case _control__WEBPACK_IMPORTED_MODULE_3__.Control.VERTICAL_ALIGNMENT_TOP:
                rootY = this._fontOffset.ascent;
                break;
            case _control__WEBPACK_IMPORTED_MODULE_3__.Control.VERTICAL_ALIGNMENT_BOTTOM:
                rootY = height - this._fontOffset.height * (this._lines.length - 1) - this._fontOffset.descent;
                break;
            case _control__WEBPACK_IMPORTED_MODULE_3__.Control.VERTICAL_ALIGNMENT_CENTER:
                rootY = this._fontOffset.ascent + (height - this._fontOffset.height * this._lines.length) / 2;
                break;
        }
        rootY += this._currentMeasure.top;
        for (var i = 0; i < this._lines.length; i++) {
            var line = this._lines[i];
            if (i !== 0 && this._lineSpacing.internalValue !== 0) {
                if (this._lineSpacing.isPixel) {
                    rootY += this._lineSpacing.getValue(this._host);
                }
                else {
                    rootY = rootY + this._lineSpacing.getValue(this._host) * this._height.getValueInPixel(this._host, this._cachedParentMeasure.height);
                }
            }
            this._drawText(line.text, line.width, rootY, context);
            rootY += this._fontOffset.height;
        }
    };
    TextBlock.prototype._computeHeightForLinesOf = function (lineCount) {
        var newHeight = this._paddingTopInPixels + this._paddingBottomInPixels + this._fontOffset.height * lineCount;
        if (lineCount > 0 && this._lineSpacing.internalValue !== 0) {
            var lineSpacing = 0;
            if (this._lineSpacing.isPixel) {
                lineSpacing = this._lineSpacing.getValue(this._host);
            }
            else {
                lineSpacing = this._lineSpacing.getValue(this._host) * this._height.getValueInPixel(this._host, this._cachedParentMeasure.height);
            }
            newHeight += (lineCount - 1) * lineSpacing;
        }
        return newHeight;
    };
    /**
     * Given a width constraint applied on the text block, find the expected height
     * @returns expected height
     */
    TextBlock.prototype.computeExpectedHeight = function () {
        var _a;
        if (this.text && this.widthInPixels) {
            // Should abstract platform instead of using LastCreatedEngine
            var context_1 = (_a = core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.EngineStore.LastCreatedEngine) === null || _a === void 0 ? void 0 : _a.createCanvas(0, 0).getContext("2d");
            if (context_1) {
                this._applyStates(context_1);
                if (!this._fontOffset) {
                    this._fontOffset = _control__WEBPACK_IMPORTED_MODULE_3__.Control._GetFontOffset(context_1.font);
                }
                var lines = this._lines
                    ? this._lines
                    : this._breakLines(this.widthInPixels - this._paddingLeftInPixels - this._paddingRightInPixels, this.heightInPixels - this._paddingTopInPixels - this._paddingBottomInPixels, context_1);
                return this._computeHeightForLinesOf(lines.length);
            }
        }
        return 0;
    };
    TextBlock.prototype.dispose = function () {
        _super.prototype.dispose.call(this);
        this.onTextChangedObservable.clear();
    };
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], TextBlock.prototype, "resizeToFit", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], TextBlock.prototype, "textWrapping", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], TextBlock.prototype, "text", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], TextBlock.prototype, "textHorizontalAlignment", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], TextBlock.prototype, "textVerticalAlignment", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], TextBlock.prototype, "lineSpacing", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], TextBlock.prototype, "outlineWidth", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], TextBlock.prototype, "underline", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], TextBlock.prototype, "lineThrough", null);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], TextBlock.prototype, "outlineColor", null);
    return TextBlock;
}(_control__WEBPACK_IMPORTED_MODULE_3__.Control));

(0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.RegisterClass)("BABYLON.GUI.TextBlock", TextBlock);


/***/ }),

/***/ "../../../lts/gui/dist/2D/controls/textWrapper.js":
/*!********************************************************!*\
  !*** ../../../lts/gui/dist/2D/controls/textWrapper.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "TextWrapper": () => (/* binding */ TextWrapper)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");

/** @hidden */
var TextWrapper = /** @class */ (function () {
    function TextWrapper() {
    }
    Object.defineProperty(TextWrapper.prototype, "text", {
        get: function () {
            return this._characters ? this._characters.join("") : this._text;
        },
        set: function (txt) {
            this._text = txt;
            this._characters = Array.from && Array.from(txt);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(TextWrapper.prototype, "length", {
        get: function () {
            return this._characters ? this._characters.length : this._text.length;
        },
        enumerable: false,
        configurable: true
    });
    TextWrapper.prototype.removePart = function (idxStart, idxEnd, insertTxt) {
        var _a;
        this._text = this._text.slice(0, idxStart) + (insertTxt ? insertTxt : "") + this._text.slice(idxEnd);
        if (this._characters) {
            var newCharacters = insertTxt ? Array.from(insertTxt) : [];
            (_a = this._characters).splice.apply(_a, (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__spreadArray)([idxStart, idxEnd - idxStart], newCharacters, false));
        }
    };
    TextWrapper.prototype.charAt = function (idx) {
        return this._characters ? this._characters[idx] : this._text.charAt(idx);
    };
    TextWrapper.prototype.substr = function (from, length) {
        if (this._characters) {
            if (isNaN(from)) {
                from = 0;
            }
            else if (from >= 0) {
                from = Math.min(from, this._characters.length);
            }
            else {
                from = this._characters.length + Math.max(from, -this._characters.length);
            }
            if (length === undefined) {
                length = this._characters.length - from;
            }
            else if (isNaN(length)) {
                length = 0;
            }
            else if (length < 0) {
                length = 0;
            }
            var temp = [];
            while (--length >= 0) {
                temp[length] = this._characters[from + length];
            }
            return temp.join("");
        }
        return this._text.substr(from, length);
    };
    TextWrapper.prototype.substring = function (from, to) {
        if (this._characters) {
            if (isNaN(from)) {
                from = 0;
            }
            else if (from > this._characters.length) {
                from = this._characters.length;
            }
            else if (from < 0) {
                from = 0;
            }
            if (to === undefined) {
                to = this._characters.length;
            }
            else if (isNaN(to)) {
                to = 0;
            }
            else if (to > this._characters.length) {
                to = this._characters.length;
            }
            else if (to < 0) {
                to = 0;
            }
            var temp = [];
            var idx = 0;
            while (from < to) {
                temp[idx++] = this._characters[from++];
            }
            return temp.join("");
        }
        return this._text.substring(from, to);
    };
    TextWrapper.prototype.isWord = function (index) {
        var rWord = /\w/g;
        return this._characters ? this._characters[index].search(rWord) !== -1 : this._text.search(rWord) !== -1;
    };
    return TextWrapper;
}());



/***/ }),

/***/ "../../../lts/gui/dist/2D/controls/toggleButton.js":
/*!*********************************************************!*\
  !*** ../../../lts/gui/dist/2D/controls/toggleButton.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "ToggleButton": () => (/* binding */ ToggleButton)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Misc/typeStore */ "core/Misc/observable");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _rectangle__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./rectangle */ "../../../lts/gui/dist/2D/controls/rectangle.js");




/**
 * Class used to create toggle buttons
 * @since 5.0.0
 */
var ToggleButton = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(ToggleButton, _super);
    /**
     * Creates a new ToggleButton
     * @param name defines the control name
     * @param group defines the toggle group this toggle belongs to
     */
    function ToggleButton(name, group) {
        var _this = _super.call(this, name) || this;
        _this.name = name;
        /** Observable raised when isActive is changed */
        _this.onIsActiveChangedObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        /**
         * Gets or sets a boolean indicating that the toggle button will let internal controls handle picking instead of doing it directly using its bounding info
         */
        _this.delegatePickingToChildren = false;
        _this._isActive = false;
        _this.group = group !== null && group !== void 0 ? group : "";
        _this.thickness = 0;
        _this.isPointerBlocker = true;
        var alphaStore = null;
        _this.toActiveAnimation = function () {
            _this.thickness = 1;
        };
        _this.toInactiveAnimation = function () {
            _this.thickness = 0;
        };
        _this.pointerEnterActiveAnimation = function () {
            alphaStore = _this.alpha;
            _this.alpha -= 0.1;
        };
        _this.pointerOutActiveAnimation = function () {
            if (alphaStore !== null) {
                _this.alpha = alphaStore;
            }
        };
        _this.pointerDownActiveAnimation = function () {
            _this.scaleX -= 0.05;
            _this.scaleY -= 0.05;
        };
        _this.pointerUpActiveAnimation = function () {
            _this.scaleX += 0.05;
            _this.scaleY += 0.05;
        };
        _this.pointerEnterInactiveAnimation = function () {
            alphaStore = _this.alpha;
            _this.alpha -= 0.1;
        };
        _this.pointerOutInactiveAnimation = function () {
            if (alphaStore !== null) {
                _this.alpha = alphaStore;
            }
        };
        _this.pointerDownInactiveAnimation = function () {
            _this.scaleX -= 0.05;
            _this.scaleY -= 0.05;
        };
        _this.pointerUpInactiveAnimation = function () {
            _this.scaleX += 0.05;
            _this.scaleY += 0.05;
        };
        return _this;
    }
    Object.defineProperty(ToggleButton.prototype, "group", {
        /** Gets or sets group name this toggle button belongs to */
        get: function () {
            return this._group;
        },
        set: function (value) {
            if (this._group === value) {
                return;
            }
            this._group = value;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ToggleButton.prototype, "isActive", {
        /** Gets or sets a boolean indicating if the toggle button is active or not */
        get: function () {
            return this._isActive;
        },
        set: function (value) {
            var _this = this;
            var _a, _b;
            // Function modeled after radioButton.ts
            if (this._isActive === value) {
                return;
            }
            this._isActive = value;
            // Update the visual state based on the new value
            if (this._isActive) {
                (_a = this.toActiveAnimation) === null || _a === void 0 ? void 0 : _a.call(this);
            }
            else {
                (_b = this.toInactiveAnimation) === null || _b === void 0 ? void 0 : _b.call(this);
            }
            this._markAsDirty();
            this.onIsActiveChangedObservable.notifyObservers(value);
            if (this._isActive && this._host && this._group) {
                // A toggle button in a group can only have 1 active element at a given time.
                // If this toggle button has a group, set other toggle buttons in the group to inactive.
                this._host.executeOnAllControls(function (control) {
                    // Check for control type ToggleButton
                    if (control.typeName === "ToggleButton") {
                        // Don't do anything to this toggle button
                        if (control === _this) {
                            return;
                        }
                        var childToggle = control;
                        // If toggle button is in same group, set isActive to false
                        if (childToggle.group === _this.group) {
                            childToggle.isActive = false;
                        }
                    }
                });
            }
        },
        enumerable: false,
        configurable: true
    });
    ToggleButton.prototype._getTypeName = function () {
        return "ToggleButton";
    };
    // While being a container, the toggle button behaves like a control.
    /**
     * @param x
     * @param y
     * @param pi
     * @param type
     * @param pointerId
     * @param buttonIndex
     * @param deltaX
     * @param deltaY
     * @hidden
     */
    ToggleButton.prototype._processPicking = function (x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY) {
        if (!this._isEnabled || !this.isHitTestVisible || !this.isVisible || this.notRenderable) {
            return false;
        }
        if (!_super.prototype.contains.call(this, x, y)) {
            return false;
        }
        if (this.delegatePickingToChildren) {
            var contains = false;
            for (var index = this._children.length - 1; index >= 0; index--) {
                var child = this._children[index];
                if (child.isEnabled && child.isHitTestVisible && child.isVisible && !child.notRenderable && child.contains(x, y)) {
                    contains = true;
                    break;
                }
            }
            if (!contains) {
                return false;
            }
        }
        this._processObservables(type, x, y, pi, pointerId, buttonIndex, deltaX, deltaY);
        return true;
    };
    /**
     * @param target
     * @param pi
     * @hidden
     */
    ToggleButton.prototype._onPointerEnter = function (target, pi) {
        if (!_super.prototype._onPointerEnter.call(this, target, pi)) {
            return false;
        }
        if (this.isReadOnly) {
            return true;
        }
        if (this._isActive) {
            if (this.pointerEnterActiveAnimation) {
                this.pointerEnterActiveAnimation();
            }
        }
        else {
            if (this.pointerEnterInactiveAnimation) {
                this.pointerEnterInactiveAnimation();
            }
        }
        return true;
    };
    /**
     * @param target
     * @param pi
     * @param force
     * @hidden
     */
    ToggleButton.prototype._onPointerOut = function (target, pi, force) {
        if (force === void 0) { force = false; }
        if (!this.isReadOnly) {
            if (this._isActive) {
                if (this.pointerOutActiveAnimation) {
                    this.pointerOutActiveAnimation();
                }
            }
            else {
                if (this.pointerOutInactiveAnimation) {
                    this.pointerOutInactiveAnimation();
                }
            }
        }
        _super.prototype._onPointerOut.call(this, target, pi, force);
    };
    /**
     * @param target
     * @param coordinates
     * @param pointerId
     * @param buttonIndex
     * @param pi
     * @hidden
     */
    ToggleButton.prototype._onPointerDown = function (target, coordinates, pointerId, buttonIndex, pi) {
        if (!_super.prototype._onPointerDown.call(this, target, coordinates, pointerId, buttonIndex, pi)) {
            return false;
        }
        if (this.isReadOnly) {
            return true;
        }
        if (this._isActive) {
            if (this.pointerDownActiveAnimation) {
                this.pointerDownActiveAnimation();
            }
        }
        else {
            if (this.pointerDownInactiveAnimation) {
                this.pointerDownInactiveAnimation();
            }
        }
        return true;
    };
    /**
     * @param target
     * @param coordinates
     * @param pointerId
     * @param buttonIndex
     * @param notifyClick
     * @param pi
     * @hidden
     */
    ToggleButton.prototype._onPointerUp = function (target, coordinates, pointerId, buttonIndex, notifyClick, pi) {
        if (!this.isReadOnly) {
            if (this._isActive) {
                if (this.pointerUpActiveAnimation) {
                    this.pointerUpActiveAnimation();
                }
            }
            else {
                if (this.pointerUpInactiveAnimation) {
                    this.pointerUpInactiveAnimation();
                }
            }
        }
        _super.prototype._onPointerUp.call(this, target, coordinates, pointerId, buttonIndex, notifyClick, pi);
    };
    return ToggleButton;
}(_rectangle__WEBPACK_IMPORTED_MODULE_2__.Rectangle));

(0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.RegisterClass)("BABYLON.GUI.ToggleButton", ToggleButton);


/***/ }),

/***/ "../../../lts/gui/dist/2D/controls/virtualKeyboard.js":
/*!************************************************************!*\
  !*** ../../../lts/gui/dist/2D/controls/virtualKeyboard.js ***!
  \************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "KeyPropertySet": () => (/* binding */ KeyPropertySet),
/* harmony export */   "VirtualKeyboard": () => (/* binding */ VirtualKeyboard)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Misc/typeStore */ "core/Misc/observable");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _stackPanel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./stackPanel */ "../../../lts/gui/dist/2D/controls/stackPanel.js");
/* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./button */ "../../../lts/gui/dist/2D/controls/button.js");





/**
 * Class used to store key control properties
 */
var KeyPropertySet = /** @class */ (function () {
    function KeyPropertySet() {
    }
    return KeyPropertySet;
}());

/**
 * Class used to create virtual keyboard
 */
var VirtualKeyboard = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(VirtualKeyboard, _super);
    function VirtualKeyboard() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        /** Observable raised when a key is pressed */
        _this.onKeyPressObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        /** Gets or sets default key button width */
        _this.defaultButtonWidth = "40px";
        /** Gets or sets default key button height */
        _this.defaultButtonHeight = "40px";
        /** Gets or sets default key button left padding */
        _this.defaultButtonPaddingLeft = "2px";
        /** Gets or sets default key button right padding */
        _this.defaultButtonPaddingRight = "2px";
        /** Gets or sets default key button top padding */
        _this.defaultButtonPaddingTop = "2px";
        /** Gets or sets default key button bottom padding */
        _this.defaultButtonPaddingBottom = "2px";
        /** Gets or sets default key button foreground color */
        _this.defaultButtonColor = "#DDD";
        /** Gets or sets default key button background color */
        _this.defaultButtonBackground = "#070707";
        /** Gets or sets shift button foreground color */
        _this.shiftButtonColor = "#7799FF";
        /** Gets or sets shift button thickness*/
        _this.selectedShiftThickness = 1;
        /** Gets shift key state */
        _this.shiftState = 0;
        _this._currentlyConnectedInputText = null;
        _this._connectedInputTexts = [];
        _this._onKeyPressObserver = null;
        return _this;
    }
    VirtualKeyboard.prototype._getTypeName = function () {
        return "VirtualKeyboard";
    };
    VirtualKeyboard.prototype._createKey = function (key, propertySet) {
        var _this = this;
        var button = _button__WEBPACK_IMPORTED_MODULE_3__.Button.CreateSimpleButton(key, key);
        button.width = propertySet && propertySet.width ? propertySet.width : this.defaultButtonWidth;
        button.height = propertySet && propertySet.height ? propertySet.height : this.defaultButtonHeight;
        button.color = propertySet && propertySet.color ? propertySet.color : this.defaultButtonColor;
        button.background = propertySet && propertySet.background ? propertySet.background : this.defaultButtonBackground;
        button.paddingLeft = propertySet && propertySet.paddingLeft ? propertySet.paddingLeft : this.defaultButtonPaddingLeft;
        button.paddingRight = propertySet && propertySet.paddingRight ? propertySet.paddingRight : this.defaultButtonPaddingRight;
        button.paddingTop = propertySet && propertySet.paddingTop ? propertySet.paddingTop : this.defaultButtonPaddingTop;
        button.paddingBottom = propertySet && propertySet.paddingBottom ? propertySet.paddingBottom : this.defaultButtonPaddingBottom;
        button.thickness = 0;
        button.isFocusInvisible = true;
        button.shadowColor = this.shadowColor;
        button.shadowBlur = this.shadowBlur;
        button.shadowOffsetX = this.shadowOffsetX;
        button.shadowOffsetY = this.shadowOffsetY;
        button.onPointerUpObservable.add(function () {
            _this.onKeyPressObservable.notifyObservers(key);
        });
        return button;
    };
    /**
     * Adds a new row of keys
     * @param keys defines the list of keys to add
     * @param propertySets defines the associated property sets
     */
    VirtualKeyboard.prototype.addKeysRow = function (keys, propertySets) {
        var panel = new _stackPanel__WEBPACK_IMPORTED_MODULE_2__.StackPanel();
        panel.isVertical = false;
        panel.isFocusInvisible = true;
        var maxKey = null;
        for (var i = 0; i < keys.length; i++) {
            var properties = null;
            if (propertySets && propertySets.length === keys.length) {
                properties = propertySets[i];
            }
            var key = this._createKey(keys[i], properties);
            if (!maxKey || key.heightInPixels > maxKey.heightInPixels) {
                maxKey = key;
            }
            panel.addControl(key);
        }
        panel.height = maxKey ? maxKey.height : this.defaultButtonHeight;
        this.addControl(panel);
    };
    /**
     * Set the shift key to a specific state
     * @param shiftState defines the new shift state
     */
    VirtualKeyboard.prototype.applyShiftState = function (shiftState) {
        if (!this.children) {
            return;
        }
        for (var i = 0; i < this.children.length; i++) {
            var row = this.children[i];
            if (!row || !row.children) {
                continue;
            }
            var rowContainer = row;
            for (var j = 0; j < rowContainer.children.length; j++) {
                var button = rowContainer.children[j];
                if (!button || !button.children[0]) {
                    continue;
                }
                var button_tblock = button.children[0];
                if (button_tblock.text === "\u21E7") {
                    button.color = shiftState ? this.shiftButtonColor : this.defaultButtonColor;
                    button.thickness = shiftState > 1 ? this.selectedShiftThickness : 0;
                }
                button_tblock.text = shiftState > 0 ? button_tblock.text.toUpperCase() : button_tblock.text.toLowerCase();
            }
        }
    };
    Object.defineProperty(VirtualKeyboard.prototype, "connectedInputText", {
        /** Gets the input text control currently attached to the keyboard */
        get: function () {
            return this._currentlyConnectedInputText;
        },
        enumerable: false,
        configurable: true
    });
    /**
     * Connects the keyboard with an input text control
     *
     * @param input defines the target control
     */
    VirtualKeyboard.prototype.connect = function (input) {
        var _this = this;
        var inputTextAlreadyConnected = this._connectedInputTexts.some(function (a) { return a.input === input; });
        if (inputTextAlreadyConnected) {
            return;
        }
        if (this._onKeyPressObserver === null) {
            this._onKeyPressObserver = this.onKeyPressObservable.add(function (key) {
                if (!_this._currentlyConnectedInputText) {
                    return;
                }
                _this._currentlyConnectedInputText._host.focusedControl = _this._currentlyConnectedInputText;
                switch (key) {
                    case "\u21E7":
                        _this.shiftState++;
                        if (_this.shiftState > 2) {
                            _this.shiftState = 0;
                        }
                        _this.applyShiftState(_this.shiftState);
                        return;
                    case "\u2190":
                        _this._currentlyConnectedInputText.processKey(8);
                        return;
                    case "\u21B5":
                        _this._currentlyConnectedInputText.processKey(13);
                        return;
                }
                _this._currentlyConnectedInputText.processKey(-1, _this.shiftState ? key.toUpperCase() : key);
                if (_this.shiftState === 1) {
                    _this.shiftState = 0;
                    _this.applyShiftState(_this.shiftState);
                }
            });
        }
        this.isVisible = false;
        this._currentlyConnectedInputText = input;
        input._connectedVirtualKeyboard = this;
        // Events hooking
        var onFocusObserver = input.onFocusObservable.add(function () {
            _this._currentlyConnectedInputText = input;
            input._connectedVirtualKeyboard = _this;
            _this.isVisible = true;
        });
        var onBlurObserver = input.onBlurObservable.add(function () {
            input._connectedVirtualKeyboard = null;
            _this._currentlyConnectedInputText = null;
            _this.isVisible = false;
        });
        this._connectedInputTexts.push({
            input: input,
            onBlurObserver: onBlurObserver,
            onFocusObserver: onFocusObserver,
        });
    };
    /**
     * Disconnects the keyboard from connected InputText controls
     *
     * @param input optionally defines a target control, otherwise all are disconnected
     */
    VirtualKeyboard.prototype.disconnect = function (input) {
        var _this = this;
        if (input) {
            // .find not available on IE
            var filtered = this._connectedInputTexts.filter(function (a) { return a.input === input; });
            if (filtered.length === 1) {
                this._removeConnectedInputObservables(filtered[0]);
                this._connectedInputTexts = this._connectedInputTexts.filter(function (a) { return a.input !== input; });
                if (this._currentlyConnectedInputText === input) {
                    this._currentlyConnectedInputText = null;
                }
            }
        }
        else {
            this._connectedInputTexts.forEach(function (connectedInputText) {
                _this._removeConnectedInputObservables(connectedInputText);
            });
            this._connectedInputTexts = [];
        }
        if (this._connectedInputTexts.length === 0) {
            this._currentlyConnectedInputText = null;
            this.onKeyPressObservable.remove(this._onKeyPressObserver);
            this._onKeyPressObserver = null;
        }
    };
    VirtualKeyboard.prototype._removeConnectedInputObservables = function (connectedInputText) {
        connectedInputText.input._connectedVirtualKeyboard = null;
        connectedInputText.input.onFocusObservable.remove(connectedInputText.onFocusObserver);
        connectedInputText.input.onBlurObservable.remove(connectedInputText.onBlurObserver);
    };
    /**
     * Release all resources
     */
    VirtualKeyboard.prototype.dispose = function () {
        _super.prototype.dispose.call(this);
        this.disconnect();
    };
    // Statics
    /**
     * Creates a new keyboard using a default layout
     *
     * @param name defines control name
     * @returns a new VirtualKeyboard
     */
    VirtualKeyboard.CreateDefaultLayout = function (name) {
        var returnValue = new VirtualKeyboard(name);
        returnValue.addKeysRow(["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "\u2190"]);
        returnValue.addKeysRow(["q", "w", "e", "r", "t", "y", "u", "i", "o", "p"]);
        returnValue.addKeysRow(["a", "s", "d", "f", "g", "h", "j", "k", "l", ";", "'", "\u21B5"]);
        returnValue.addKeysRow(["\u21E7", "z", "x", "c", "v", "b", "n", "m", ",", ".", "/"]);
        returnValue.addKeysRow([" "], [{ width: "200px" }]);
        return returnValue;
    };
    /**
     * @param serializedObject
     * @param host
     * @hidden
     */
    VirtualKeyboard.prototype._parseFromContent = function (serializedObject, host) {
        var _this = this;
        _super.prototype._parseFromContent.call(this, serializedObject, host);
        for (var _i = 0, _a = this.children; _i < _a.length; _i++) {
            var row = _a[_i];
            if (row.getClassName() === "StackPanel") {
                var stackPanel = row;
                var _loop_1 = function (key) {
                    if (key.getClassName() === "Button" && key.name) {
                        key.onPointerUpObservable.add(function () {
                            _this.onKeyPressObservable.notifyObservers(key.name);
                        });
                    }
                };
                for (var _b = 0, _c = stackPanel.children; _b < _c.length; _b++) {
                    var key = _c[_b];
                    _loop_1(key);
                }
            }
        }
    };
    return VirtualKeyboard;
}(_stackPanel__WEBPACK_IMPORTED_MODULE_2__.StackPanel));

(0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.RegisterClass)("BABYLON.GUI.VirtualKeyboard", VirtualKeyboard);


/***/ }),

/***/ "../../../lts/gui/dist/2D/index.js":
/*!*****************************************!*\
  !*** ../../../lts/gui/dist/2D/index.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "AdvancedDynamicTexture": () => (/* reexport safe */ _advancedDynamicTexture__WEBPACK_IMPORTED_MODULE_1__.AdvancedDynamicTexture),
/* harmony export */   "AdvancedDynamicTextureInstrumentation": () => (/* reexport safe */ _adtInstrumentation__WEBPACK_IMPORTED_MODULE_2__.AdvancedDynamicTextureInstrumentation),
/* harmony export */   "BaseSlider": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.BaseSlider),
/* harmony export */   "Button": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.Button),
/* harmony export */   "Checkbox": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.Checkbox),
/* harmony export */   "CheckboxGroup": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.CheckboxGroup),
/* harmony export */   "ColorPicker": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.ColorPicker),
/* harmony export */   "Container": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.Container),
/* harmony export */   "Control": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.Control),
/* harmony export */   "DisplayGrid": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.DisplayGrid),
/* harmony export */   "Ellipse": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.Ellipse),
/* harmony export */   "FocusableButton": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.FocusableButton),
/* harmony export */   "Grid": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.Grid),
/* harmony export */   "Image": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.Image),
/* harmony export */   "ImageBasedSlider": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.ImageBasedSlider),
/* harmony export */   "ImageScrollBar": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.ImageScrollBar),
/* harmony export */   "InputPassword": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.InputPassword),
/* harmony export */   "InputText": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.InputText),
/* harmony export */   "KeyPropertySet": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.KeyPropertySet),
/* harmony export */   "Line": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.Line),
/* harmony export */   "Matrix2D": () => (/* reexport safe */ _math2D__WEBPACK_IMPORTED_MODULE_3__.Matrix2D),
/* harmony export */   "Measure": () => (/* reexport safe */ _measure__WEBPACK_IMPORTED_MODULE_4__.Measure),
/* harmony export */   "MultiLine": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.MultiLine),
/* harmony export */   "MultiLinePoint": () => (/* reexport safe */ _multiLinePoint__WEBPACK_IMPORTED_MODULE_5__.MultiLinePoint),
/* harmony export */   "RadioButton": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.RadioButton),
/* harmony export */   "RadioGroup": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.RadioGroup),
/* harmony export */   "Rectangle": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.Rectangle),
/* harmony export */   "ScrollBar": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.ScrollBar),
/* harmony export */   "ScrollViewer": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.ScrollViewer),
/* harmony export */   "SelectionPanel": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.SelectionPanel),
/* harmony export */   "SelectorGroup": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.SelectorGroup),
/* harmony export */   "Slider": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.Slider),
/* harmony export */   "SliderGroup": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.SliderGroup),
/* harmony export */   "StackPanel": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.StackPanel),
/* harmony export */   "Style": () => (/* reexport safe */ _style__WEBPACK_IMPORTED_MODULE_6__.Style),
/* harmony export */   "TextBlock": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.TextBlock),
/* harmony export */   "TextWrapper": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.TextWrapper),
/* harmony export */   "TextWrapping": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.TextWrapping),
/* harmony export */   "ToggleButton": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.ToggleButton),
/* harmony export */   "ValueAndUnit": () => (/* reexport safe */ _valueAndUnit__WEBPACK_IMPORTED_MODULE_7__.ValueAndUnit),
/* harmony export */   "Vector2WithInfo": () => (/* reexport safe */ _math2D__WEBPACK_IMPORTED_MODULE_3__.Vector2WithInfo),
/* harmony export */   "VirtualKeyboard": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.VirtualKeyboard),
/* harmony export */   "XmlLoader": () => (/* reexport safe */ _xmlLoader__WEBPACK_IMPORTED_MODULE_8__.XmlLoader),
/* harmony export */   "name": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.name)
/* harmony export */ });
/* harmony import */ var _controls_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./controls/index */ "../../../lts/gui/dist/2D/controls/index.js");
/* harmony import */ var _advancedDynamicTexture__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./advancedDynamicTexture */ "../../../lts/gui/dist/2D/advancedDynamicTexture.js");
/* harmony import */ var _adtInstrumentation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./adtInstrumentation */ "../../../lts/gui/dist/2D/adtInstrumentation.js");
/* harmony import */ var _math2D__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./math2D */ "../../../lts/gui/dist/2D/math2D.js");
/* harmony import */ var _measure__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./measure */ "../../../lts/gui/dist/2D/measure.js");
/* harmony import */ var _multiLinePoint__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./multiLinePoint */ "../../../lts/gui/dist/2D/multiLinePoint.js");
/* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./style */ "../../../lts/gui/dist/2D/style.js");
/* harmony import */ var _valueAndUnit__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./valueAndUnit */ "../../../lts/gui/dist/2D/valueAndUnit.js");
/* harmony import */ var _xmlLoader__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./xmlLoader */ "../../../lts/gui/dist/2D/xmlLoader.js");
/* eslint-disable import/no-internal-modules */











/***/ }),

/***/ "../../../lts/gui/dist/2D/math2D.js":
/*!******************************************!*\
  !*** ../../../lts/gui/dist/2D/math2D.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Matrix2D": () => (/* binding */ Matrix2D),
/* harmony export */   "Vector2WithInfo": () => (/* binding */ Vector2WithInfo)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Maths/math.constants */ "core/Misc/observable");
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__);



/**
 * Class used to transport Vector2 information for pointer events
 */
var Vector2WithInfo = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(Vector2WithInfo, _super);
    /**
     * Creates a new Vector2WithInfo
     * @param source defines the vector2 data to transport
     * @param buttonIndex defines the current mouse button index
     */
    function Vector2WithInfo(source, 
    /** defines the current mouse button index */
    buttonIndex) {
        if (buttonIndex === void 0) { buttonIndex = 0; }
        var _this = _super.call(this, source.x, source.y) || this;
        _this.buttonIndex = buttonIndex;
        return _this;
    }
    return Vector2WithInfo;
}(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Vector2));

/** Class used to provide 2D matrix features */
var Matrix2D = /** @class */ (function () {
    /**
     * Creates a new matrix
     * @param m00 defines value for (0, 0)
     * @param m01 defines value for (0, 1)
     * @param m10 defines value for (1, 0)
     * @param m11 defines value for (1, 1)
     * @param m20 defines value for (2, 0)
     * @param m21 defines value for (2, 1)
     */
    function Matrix2D(m00, m01, m10, m11, m20, m21) {
        /** Gets the internal array of 6 floats used to store matrix data */
        this.m = new Float32Array(6);
        this.fromValues(m00, m01, m10, m11, m20, m21);
    }
    /**
     * Fills the matrix from direct values
     * @param m00 defines value for (0, 0)
     * @param m01 defines value for (0, 1)
     * @param m10 defines value for (1, 0)
     * @param m11 defines value for (1, 1)
     * @param m20 defines value for (2, 0)
     * @param m21 defines value for (2, 1)
     * @returns the current modified matrix
     */
    Matrix2D.prototype.fromValues = function (m00, m01, m10, m11, m20, m21) {
        this.m[0] = m00;
        this.m[1] = m01;
        this.m[2] = m10;
        this.m[3] = m11;
        this.m[4] = m20;
        this.m[5] = m21;
        return this;
    };
    /**
     * Gets matrix determinant
     * @returns the determinant
     */
    Matrix2D.prototype.determinant = function () {
        return this.m[0] * this.m[3] - this.m[1] * this.m[2];
    };
    /**
     * Inverses the matrix and stores it in a target matrix
     * @param result defines the target matrix
     * @returns the current matrix
     */
    Matrix2D.prototype.invertToRef = function (result) {
        var l0 = this.m[0];
        var l1 = this.m[1];
        var l2 = this.m[2];
        var l3 = this.m[3];
        var l4 = this.m[4];
        var l5 = this.m[5];
        var det = this.determinant();
        if (det < core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Epsilon * core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Epsilon) {
            result.m[0] = 0;
            result.m[1] = 0;
            result.m[2] = 0;
            result.m[3] = 0;
            result.m[4] = 0;
            result.m[5] = 0;
            return this;
        }
        var detDiv = 1 / det;
        var det4 = l2 * l5 - l3 * l4;
        var det5 = l1 * l4 - l0 * l5;
        result.m[0] = l3 * detDiv;
        result.m[1] = -l1 * detDiv;
        result.m[2] = -l2 * detDiv;
        result.m[3] = l0 * detDiv;
        result.m[4] = det4 * detDiv;
        result.m[5] = det5 * detDiv;
        return this;
    };
    /**
     * Multiplies the current matrix with another one
     * @param other defines the second operand
     * @param result defines the target matrix
     * @returns the current matrix
     */
    Matrix2D.prototype.multiplyToRef = function (other, result) {
        var l0 = this.m[0];
        var l1 = this.m[1];
        var l2 = this.m[2];
        var l3 = this.m[3];
        var l4 = this.m[4];
        var l5 = this.m[5];
        var r0 = other.m[0];
        var r1 = other.m[1];
        var r2 = other.m[2];
        var r3 = other.m[3];
        var r4 = other.m[4];
        var r5 = other.m[5];
        result.m[0] = l0 * r0 + l1 * r2;
        result.m[1] = l0 * r1 + l1 * r3;
        result.m[2] = l2 * r0 + l3 * r2;
        result.m[3] = l2 * r1 + l3 * r3;
        result.m[4] = l4 * r0 + l5 * r2 + r4;
        result.m[5] = l4 * r1 + l5 * r3 + r5;
        return this;
    };
    /**
     * Applies the current matrix to a set of 2 floats and stores the result in a vector2
     * @param x defines the x coordinate to transform
     * @param y defines the x coordinate to transform
     * @param result defines the target vector2
     * @returns the current matrix
     */
    Matrix2D.prototype.transformCoordinates = function (x, y, result) {
        result.x = x * this.m[0] + y * this.m[2] + this.m[4];
        result.y = x * this.m[1] + y * this.m[3] + this.m[5];
        return this;
    };
    // Statics
    /**
     * Creates an identity matrix
     * @returns a new matrix
     */
    Matrix2D.Identity = function () {
        return new Matrix2D(1, 0, 0, 1, 0, 0);
    };
    /**
     * Creates an identity matrix and stores it in a target matrix
     * @param result defines the target matrix
     */
    Matrix2D.IdentityToRef = function (result) {
        result.m[0] = 1;
        result.m[1] = 0;
        result.m[2] = 0;
        result.m[3] = 1;
        result.m[4] = 0;
        result.m[5] = 0;
    };
    /**
     * Creates a translation matrix and stores it in a target matrix
     * @param x defines the x coordinate of the translation
     * @param y defines the y coordinate of the translation
     * @param result defines the target matrix
     */
    Matrix2D.TranslationToRef = function (x, y, result) {
        result.fromValues(1, 0, 0, 1, x, y);
    };
    /**
     * Creates a scaling matrix and stores it in a target matrix
     * @param x defines the x coordinate of the scaling
     * @param y defines the y coordinate of the scaling
     * @param result defines the target matrix
     */
    Matrix2D.ScalingToRef = function (x, y, result) {
        result.fromValues(x, 0, 0, y, 0, 0);
    };
    /**
     * Creates a rotation matrix and stores it in a target matrix
     * @param angle defines the rotation angle
     * @param result defines the target matrix
     */
    Matrix2D.RotationToRef = function (angle, result) {
        var s = Math.sin(angle);
        var c = Math.cos(angle);
        result.fromValues(c, s, -s, c, 0, 0);
    };
    /**
     * Composes a matrix from translation, rotation, scaling and parent matrix and stores it in a target matrix
     * @param tx defines the x coordinate of the translation
     * @param ty defines the y coordinate of the translation
     * @param angle defines the rotation angle
     * @param scaleX defines the x coordinate of the scaling
     * @param scaleY defines the y coordinate of the scaling
     * @param parentMatrix defines the parent matrix to multiply by (can be null)
     * @param result defines the target matrix
     */
    Matrix2D.ComposeToRef = function (tx, ty, angle, scaleX, scaleY, parentMatrix, result) {
        Matrix2D.TranslationToRef(tx, ty, Matrix2D._TempPreTranslationMatrix);
        Matrix2D.ScalingToRef(scaleX, scaleY, Matrix2D._TempScalingMatrix);
        Matrix2D.RotationToRef(angle, Matrix2D._TempRotationMatrix);
        Matrix2D.TranslationToRef(-tx, -ty, Matrix2D._TempPostTranslationMatrix);
        Matrix2D._TempPreTranslationMatrix.multiplyToRef(Matrix2D._TempScalingMatrix, Matrix2D._TempCompose0);
        Matrix2D._TempCompose0.multiplyToRef(Matrix2D._TempRotationMatrix, Matrix2D._TempCompose1);
        if (parentMatrix) {
            Matrix2D._TempCompose1.multiplyToRef(Matrix2D._TempPostTranslationMatrix, Matrix2D._TempCompose2);
            Matrix2D._TempCompose2.multiplyToRef(parentMatrix, result);
        }
        else {
            Matrix2D._TempCompose1.multiplyToRef(Matrix2D._TempPostTranslationMatrix, result);
        }
    };
    Matrix2D._TempPreTranslationMatrix = Matrix2D.Identity();
    Matrix2D._TempPostTranslationMatrix = Matrix2D.Identity();
    Matrix2D._TempRotationMatrix = Matrix2D.Identity();
    Matrix2D._TempScalingMatrix = Matrix2D.Identity();
    Matrix2D._TempCompose0 = Matrix2D.Identity();
    Matrix2D._TempCompose1 = Matrix2D.Identity();
    Matrix2D._TempCompose2 = Matrix2D.Identity();
    return Matrix2D;
}());



/***/ }),

/***/ "../../../lts/gui/dist/2D/measure.js":
/*!*******************************************!*\
  !*** ../../../lts/gui/dist/2D/measure.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Measure": () => (/* binding */ Measure)
/* harmony export */ });
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Maths/math.vector */ "core/Misc/observable");
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__);

var tmpRect = [new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__.Vector2(0, 0), new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__.Vector2(0, 0), new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__.Vector2(0, 0), new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__.Vector2(0, 0)];
var tmpRect2 = [new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__.Vector2(0, 0), new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__.Vector2(0, 0), new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__.Vector2(0, 0), new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__.Vector2(0, 0)];
var tmpV1 = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__.Vector2(0, 0);
var tmpV2 = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__.Vector2(0, 0);
/**
 * Class used to store 2D control sizes
 */
var Measure = /** @class */ (function () {
    /**
     * Creates a new measure
     * @param left defines left coordinate
     * @param top defines top coordinate
     * @param width defines width dimension
     * @param height defines height dimension
     */
    function Measure(
    /** defines left coordinate */
    left, 
    /** defines top coordinate  */
    top, 
    /** defines width dimension  */
    width, 
    /** defines height dimension */
    height) {
        this.left = left;
        this.top = top;
        this.width = width;
        this.height = height;
    }
    /**
     * Copy from another measure
     * @param other defines the other measure to copy from
     */
    Measure.prototype.copyFrom = function (other) {
        this.left = other.left;
        this.top = other.top;
        this.width = other.width;
        this.height = other.height;
    };
    /**
     * Copy from a group of 4 floats
     * @param left defines left coordinate
     * @param top defines top coordinate
     * @param width defines width dimension
     * @param height defines height dimension
     */
    Measure.prototype.copyFromFloats = function (left, top, width, height) {
        this.left = left;
        this.top = top;
        this.width = width;
        this.height = height;
    };
    /**
     * Computes the axis aligned bounding box measure for two given measures
     * @param a Input measure
     * @param b Input measure
     * @param result the resulting bounding measure
     */
    Measure.CombineToRef = function (a, b, result) {
        var left = Math.min(a.left, b.left);
        var top = Math.min(a.top, b.top);
        var right = Math.max(a.left + a.width, b.left + b.width);
        var bottom = Math.max(a.top + a.height, b.top + b.height);
        result.left = left;
        result.top = top;
        result.width = right - left;
        result.height = bottom - top;
    };
    /**
     * Computes the axis aligned bounding box of the measure after it is modified by a given transform
     * @param transform the matrix to transform the measure before computing the AABB
     * @param addX number to add to left
     * @param addY number to add to top
     * @param addWidth number to add to width
     * @param addHeight number to add to height
     * @param result the resulting AABB
     */
    Measure.prototype.addAndTransformToRef = function (transform, addX, addY, addWidth, addHeight, result) {
        var left = this.left + addX;
        var top = this.top + addY;
        var width = this.width + addWidth;
        var height = this.height + addHeight;
        tmpRect[0].copyFromFloats(left, top);
        tmpRect[1].copyFromFloats(left + width, top);
        tmpRect[2].copyFromFloats(left + width, top + height);
        tmpRect[3].copyFromFloats(left, top + height);
        tmpV1.copyFromFloats(Number.MAX_VALUE, Number.MAX_VALUE);
        tmpV2.copyFromFloats(0, 0);
        for (var i = 0; i < 4; i++) {
            transform.transformCoordinates(tmpRect[i].x, tmpRect[i].y, tmpRect2[i]);
            tmpV1.x = Math.floor(Math.min(tmpV1.x, tmpRect2[i].x));
            tmpV1.y = Math.floor(Math.min(tmpV1.y, tmpRect2[i].y));
            tmpV2.x = Math.ceil(Math.max(tmpV2.x, tmpRect2[i].x));
            tmpV2.y = Math.ceil(Math.max(tmpV2.y, tmpRect2[i].y));
        }
        result.left = tmpV1.x;
        result.top = tmpV1.y;
        result.width = tmpV2.x - tmpV1.x;
        result.height = tmpV2.y - tmpV1.y;
    };
    /**
     * Computes the axis aligned bounding box of the measure after it is modified by a given transform
     * @param transform the matrix to transform the measure before computing the AABB
     * @param result the resulting AABB
     */
    Measure.prototype.transformToRef = function (transform, result) {
        this.addAndTransformToRef(transform, 0, 0, 0, 0, result);
    };
    /**
     * Check equality between this measure and another one
     * @param other defines the other measures
     * @returns true if both measures are equals
     */
    Measure.prototype.isEqualsTo = function (other) {
        if (this.left !== other.left) {
            return false;
        }
        if (this.top !== other.top) {
            return false;
        }
        if (this.width !== other.width) {
            return false;
        }
        if (this.height !== other.height) {
            return false;
        }
        return true;
    };
    /**
     * Creates an empty measure
     * @returns a new measure
     */
    Measure.Empty = function () {
        return new Measure(0, 0, 0, 0);
    };
    return Measure;
}());



/***/ }),

/***/ "../../../lts/gui/dist/2D/multiLinePoint.js":
/*!**************************************************!*\
  !*** ../../../lts/gui/dist/2D/multiLinePoint.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "MultiLinePoint": () => (/* binding */ MultiLinePoint)
/* harmony export */ });
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Maths/math.constants */ "core/Misc/observable");
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _valueAndUnit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./valueAndUnit */ "../../../lts/gui/dist/2D/valueAndUnit.js");



/**
 * Class used to store a point for a MultiLine object.
 * The point can be pure 2D coordinates, a mesh or a control
 */
var MultiLinePoint = /** @class */ (function () {
    /**
     * Creates a new MultiLinePoint
     * @param multiLine defines the source MultiLine object
     */
    function MultiLinePoint(multiLine) {
        this._multiLine = multiLine;
        this._x = new _valueAndUnit__WEBPACK_IMPORTED_MODULE_1__.ValueAndUnit(0);
        this._y = new _valueAndUnit__WEBPACK_IMPORTED_MODULE_1__.ValueAndUnit(0);
        this._point = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__.Vector3(0, 0, 0);
    }
    Object.defineProperty(MultiLinePoint.prototype, "x", {
        /** Gets or sets x coordinate */
        get: function () {
            return this._x.toString(this._multiLine._host);
        },
        set: function (value) {
            if (this._x.toString(this._multiLine._host) === value) {
                return;
            }
            if (this._x.fromString(value)) {
                this._multiLine._markAsDirty();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(MultiLinePoint.prototype, "y", {
        /** Gets or sets y coordinate */
        get: function () {
            return this._y.toString(this._multiLine._host);
        },
        set: function (value) {
            if (this._y.toString(this._multiLine._host) === value) {
                return;
            }
            if (this._y.fromString(value)) {
                this._multiLine._markAsDirty();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(MultiLinePoint.prototype, "control", {
        /** Gets or sets the control associated with this point */
        get: function () {
            return this._control;
        },
        set: function (value) {
            if (this._control === value) {
                return;
            }
            if (this._control && this._controlObserver) {
                this._control.onDirtyObservable.remove(this._controlObserver);
                this._controlObserver = null;
            }
            this._control = value;
            if (this._control) {
                this._controlObserver = this._control.onDirtyObservable.add(this._multiLine.onPointUpdate);
            }
            this._multiLine._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(MultiLinePoint.prototype, "mesh", {
        /** Gets or sets the mesh associated with this point */
        get: function () {
            return this._mesh;
        },
        set: function (value) {
            if (this._mesh === value) {
                return;
            }
            if (this._mesh && this._meshObserver) {
                this._mesh.getScene().onAfterCameraRenderObservable.remove(this._meshObserver);
            }
            this._mesh = value;
            if (this._mesh) {
                this._meshObserver = this._mesh.getScene().onAfterCameraRenderObservable.add(this._multiLine.onPointUpdate);
            }
            this._multiLine._markAsDirty();
        },
        enumerable: false,
        configurable: true
    });
    /** Resets links */
    MultiLinePoint.prototype.resetLinks = function () {
        this.control = null;
        this.mesh = null;
    };
    /**
     * Gets a translation vector with Z component
     * @returns the translation vector
     */
    MultiLinePoint.prototype.translate = function () {
        this._point = this._translatePoint();
        return this._point;
    };
    MultiLinePoint.prototype._translatePoint = function () {
        if (this._mesh != null) {
            return this._multiLine._host.getProjectedPositionWithZ(this._mesh.getBoundingInfo().boundingSphere.center, this._mesh.getWorldMatrix());
        }
        else if (this._control != null) {
            return new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__.Vector3(this._control.centerX, this._control.centerY, 1 - core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__.Epsilon);
        }
        else {
            var host = this._multiLine._host;
            var xValue = this._x.getValueInPixel(host, Number(host._canvas.width));
            var yValue = this._y.getValueInPixel(host, Number(host._canvas.height));
            return new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__.Vector3(xValue, yValue, 1 - core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__.Epsilon);
        }
    };
    /** Release associated resources */
    MultiLinePoint.prototype.dispose = function () {
        this.resetLinks();
    };
    return MultiLinePoint;
}());



/***/ }),

/***/ "../../../lts/gui/dist/2D/style.js":
/*!*****************************************!*\
  !*** ../../../lts/gui/dist/2D/style.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Style": () => (/* binding */ Style)
/* harmony export */ });
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Misc/observable */ "core/Misc/observable");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _valueAndUnit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./valueAndUnit */ "../../../lts/gui/dist/2D/valueAndUnit.js");


/**
 * Define a style used by control to automatically setup properties based on a template.
 * Only support font related properties so far
 */
var Style = /** @class */ (function () {
    /**
     * Creates a new style object
     * @param host defines the AdvancedDynamicTexture which hosts this style
     */
    function Style(host) {
        this._fontFamily = "Arial";
        this._fontStyle = "";
        this._fontWeight = "";
        /** @hidden */
        this._fontSize = new _valueAndUnit__WEBPACK_IMPORTED_MODULE_1__.ValueAndUnit(18, _valueAndUnit__WEBPACK_IMPORTED_MODULE_1__.ValueAndUnit.UNITMODE_PIXEL, false);
        /**
         * Observable raised when the style values are changed
         */
        this.onChangedObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this._host = host;
    }
    Object.defineProperty(Style.prototype, "fontSize", {
        /**
         * Gets or sets the font size
         */
        get: function () {
            return this._fontSize.toString(this._host);
        },
        set: function (value) {
            if (this._fontSize.toString(this._host) === value) {
                return;
            }
            if (this._fontSize.fromString(value)) {
                this.onChangedObservable.notifyObservers(this);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Style.prototype, "fontFamily", {
        /**
         * Gets or sets the font family
         */
        get: function () {
            return this._fontFamily;
        },
        set: function (value) {
            if (this._fontFamily === value) {
                return;
            }
            this._fontFamily = value;
            this.onChangedObservable.notifyObservers(this);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Style.prototype, "fontStyle", {
        /**
         * Gets or sets the font style
         */
        get: function () {
            return this._fontStyle;
        },
        set: function (value) {
            if (this._fontStyle === value) {
                return;
            }
            this._fontStyle = value;
            this.onChangedObservable.notifyObservers(this);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Style.prototype, "fontWeight", {
        /** Gets or sets font weight */
        get: function () {
            return this._fontWeight;
        },
        set: function (value) {
            if (this._fontWeight === value) {
                return;
            }
            this._fontWeight = value;
            this.onChangedObservable.notifyObservers(this);
        },
        enumerable: false,
        configurable: true
    });
    /** Dispose all associated resources */
    Style.prototype.dispose = function () {
        this.onChangedObservable.clear();
    };
    return Style;
}());



/***/ }),

/***/ "../../../lts/gui/dist/2D/valueAndUnit.js":
/*!************************************************!*\
  !*** ../../../lts/gui/dist/2D/valueAndUnit.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "ValueAndUnit": () => (/* binding */ ValueAndUnit)
/* harmony export */ });
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Misc/observable */ "core/Misc/observable");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__);

/**
 * Class used to specific a value and its associated unit
 */
var ValueAndUnit = /** @class */ (function () {
    /**
     * Creates a new ValueAndUnit
     * @param value defines the value to store
     * @param unit defines the unit to store - defaults to ValueAndUnit.UNITMODE_PIXEL
     * @param negativeValueAllowed defines a boolean indicating if the value can be negative
     */
    function ValueAndUnit(value, 
    /** defines the unit to store */
    unit, 
    /** defines a boolean indicating if the value can be negative */
    negativeValueAllowed) {
        if (unit === void 0) { unit = ValueAndUnit.UNITMODE_PIXEL; }
        if (negativeValueAllowed === void 0) { negativeValueAllowed = true; }
        this.negativeValueAllowed = negativeValueAllowed;
        this._value = 1;
        this._unit = ValueAndUnit.UNITMODE_PIXEL;
        /**
         * Gets or sets a value indicating that this value will not scale accordingly with adaptive scaling property
         * @see https://doc.babylonjs.com/how_to/gui#adaptive-scaling
         */
        this.ignoreAdaptiveScaling = false;
        /**
         * Observable event triggered each time the value or unit changes
         */
        this.onChangedObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        this._value = value;
        this._unit = unit;
        this._originalUnit = unit;
    }
    Object.defineProperty(ValueAndUnit.prototype, "isPercentage", {
        /** Gets a boolean indicating if the value is a percentage */
        get: function () {
            return this._unit === ValueAndUnit.UNITMODE_PERCENTAGE;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ValueAndUnit.prototype, "isPixel", {
        /** Gets a boolean indicating if the value is store as pixel */
        get: function () {
            return this._unit === ValueAndUnit.UNITMODE_PIXEL;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ValueAndUnit.prototype, "internalValue", {
        /**
         * Gets value (without units)
         * @deprecated use value property instead
         */
        get: function () {
            return this._value;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ValueAndUnit.prototype, "value", {
        /** Gets value (without units) */
        get: function () {
            return this._value;
        },
        /** Sets value (without units) */
        set: function (value) {
            if (value !== this._value) {
                this._value = value;
                this.onChangedObservable.notifyObservers();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ValueAndUnit.prototype, "unit", {
        /** Gets units (without value) */
        get: function () {
            return this._unit;
        },
        /** Sets units (without value) */
        set: function (value) {
            if (value !== this._unit) {
                this._unit = value;
                this.onChangedObservable.notifyObservers();
            }
        },
        enumerable: false,
        configurable: true
    });
    /**
     * Gets value as pixel
     * @param host defines the root host
     * @param refValue defines the reference value for percentages
     * @returns the value as pixel
     */
    ValueAndUnit.prototype.getValueInPixel = function (host, refValue) {
        if (this.isPixel) {
            return this.getValue(host);
        }
        return this.getValue(host) * refValue;
    };
    /**
     * Update the current value and unit.
     * @param value defines the value to store
     * @param unit defines the unit to store
     * @returns the current ValueAndUnit
     */
    ValueAndUnit.prototype.updateInPlace = function (value, unit) {
        if (unit === void 0) { unit = ValueAndUnit.UNITMODE_PIXEL; }
        if (this.value !== value || this.unit !== unit) {
            // set member variables to notify only once
            this._value = value;
            this._unit = unit;
            this.onChangedObservable.notifyObservers();
        }
        return this;
    };
    /**
     * Gets the value accordingly to its unit
     * @param host  defines the root host
     * @returns the value
     */
    ValueAndUnit.prototype.getValue = function (host) {
        if (host && !this.ignoreAdaptiveScaling && this.unit !== ValueAndUnit.UNITMODE_PERCENTAGE) {
            var width = 0;
            var height = 0;
            if (host.idealWidth) {
                width = (this._value * host.getSize().width) / host.idealWidth;
            }
            if (host.idealHeight) {
                height = (this._value * host.getSize().height) / host.idealHeight;
            }
            if (host.useSmallestIdeal && host.idealWidth && host.idealHeight) {
                return window.innerWidth < window.innerHeight ? width : height;
            }
            if (host.idealWidth) {
                // horizontal
                return width;
            }
            if (host.idealHeight) {
                // vertical
                return height;
            }
        }
        return this._value;
    };
    /**
     * Gets a string representation of the value
     * @param host defines the root host
     * @param decimals defines an optional number of decimals to display
     * @returns a string
     */
    ValueAndUnit.prototype.toString = function (host, decimals) {
        switch (this._unit) {
            case ValueAndUnit.UNITMODE_PERCENTAGE: {
                var percentage = this.getValue(host) * 100;
                return (decimals ? percentage.toFixed(decimals) : percentage) + "%";
            }
            case ValueAndUnit.UNITMODE_PIXEL: {
                var pixels = this.getValue(host);
                return (decimals ? pixels.toFixed(decimals) : pixels) + "px";
            }
        }
        return this._unit.toString();
    };
    /**
     * Store a value parsed from a string
     * @param source defines the source string
     * @returns true if the value was successfully parsed and updated
     */
    ValueAndUnit.prototype.fromString = function (source) {
        var match = ValueAndUnit._Regex.exec(source.toString());
        if (!match || match.length === 0) {
            return false;
        }
        var sourceValue = parseFloat(match[1]);
        var sourceUnit = this._originalUnit;
        if (!this.negativeValueAllowed) {
            if (sourceValue < 0) {
                sourceValue = 0;
            }
        }
        if (match.length === 4) {
            switch (match[3]) {
                case "px":
                    sourceUnit = ValueAndUnit.UNITMODE_PIXEL;
                    break;
                case "%":
                    sourceUnit = ValueAndUnit.UNITMODE_PERCENTAGE;
                    sourceValue /= 100.0;
                    break;
            }
        }
        if (sourceValue === this._value && sourceUnit === this._unit) {
            return false;
        }
        this._value = sourceValue;
        this._unit = sourceUnit;
        this.onChangedObservable.notifyObservers();
        return true;
    };
    Object.defineProperty(ValueAndUnit, "UNITMODE_PERCENTAGE", {
        /** UNITMODE_PERCENTAGE */
        get: function () {
            return ValueAndUnit._UNITMODE_PERCENTAGE;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ValueAndUnit, "UNITMODE_PIXEL", {
        /** UNITMODE_PIXEL */
        get: function () {
            return ValueAndUnit._UNITMODE_PIXEL;
        },
        enumerable: false,
        configurable: true
    });
    // Static
    ValueAndUnit._Regex = /(^-?\d*(\.\d+)?)(%|px)?/;
    ValueAndUnit._UNITMODE_PERCENTAGE = 0;
    ValueAndUnit._UNITMODE_PIXEL = 1;
    return ValueAndUnit;
}());



/***/ }),

/***/ "../../../lts/gui/dist/2D/xmlLoader.js":
/*!*********************************************!*\
  !*** ../../../lts/gui/dist/2D/xmlLoader.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "XmlLoader": () => (/* binding */ XmlLoader)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Misc/typeStore */ "core/Misc/observable");
/* harmony import */ var core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_1__);


var XmlLoaderError = "XmlLoader Exception : XML file is malformed or corrupted.";
/**
 * Class used to load GUI via XML.
 */
var XmlLoader = /** @class */ (function () {
    /**
     * Create a new xml loader
     * @param parentClass Sets the class context. Used when the loader is instanced inside a class and not in a global context
     */
    function XmlLoader(parentClass) {
        if (parentClass === void 0) { parentClass = null; }
        this._nodes = {};
        this._nodeTypes = {
            element: 1,
            attribute: 2,
            text: 3,
        };
        this._isLoaded = false;
        this._objectAttributes = {
            textHorizontalAlignment: 1,
            textVerticalAlignment: 2,
            horizontalAlignment: 3,
            verticalAlignment: 4,
            stretch: 5,
        };
        if (parentClass) {
            this._parentClass = parentClass;
        }
    }
    XmlLoader.prototype._getChainElement = function (attributeValue) {
        var element = window;
        if (this._parentClass) {
            element = this._parentClass;
        }
        var value = attributeValue;
        value = value.split(".");
        for (var i = 0; i < value.length; i++) {
            element = element[value[i]];
        }
        return element;
    };
    XmlLoader.prototype._getClassAttribute = function (attributeName) {
        var attribute = attributeName.split(".");
        var className = (0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_1__.GetClass)("BABYLON.GUI." + attribute[0]);
        return className[attribute[1]];
    };
    XmlLoader.prototype._createGuiElement = function (node, parent, linkParent) {
        if (linkParent === void 0) { linkParent = true; }
        try {
            var className = (0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_1__.GetClass)("BABYLON.GUI." + node.nodeName);
            var guiNode = new className();
            if (parent && linkParent) {
                parent.addControl(guiNode);
            }
            for (var i = 0; i < node.attributes.length; i++) {
                if (node.attributes[i].name.toLowerCase().includes("datasource")) {
                    continue;
                }
                if (node.attributes[i].name.toLowerCase().includes("observable")) {
                    var element = this._getChainElement(node.attributes[i].value);
                    guiNode[node.attributes[i].name].add(element);
                    continue;
                }
                else if (node.attributes[i].name == "linkWithMesh") {
                    if (this._parentClass) {
                        guiNode.linkWithMesh(this._parentClass[node.attributes[i].value]);
                    }
                    else {
                        guiNode.linkWithMesh(window[node.attributes[i].value]);
                    }
                }
                else if (node.attributes[i].value.startsWith("{{") && node.attributes[i].value.endsWith("}}")) {
                    var element = this._getChainElement(node.attributes[i].value.substring(2, node.attributes[i].value.length - 2));
                    guiNode[node.attributes[i].name] = element;
                }
                else if (!this._objectAttributes[node.attributes[i].name]) {
                    if (node.attributes[i].value == "true" || node.attributes[i].value == "false") {
                        guiNode[node.attributes[i].name] = node.attributes[i].value == "true";
                    }
                    else {
                        guiNode[node.attributes[i].name] = !isNaN(Number(node.attributes[i].value)) ? Number(node.attributes[i].value) : node.attributes[i].value;
                    }
                }
                else {
                    guiNode[node.attributes[i].name] = this._getClassAttribute(node.attributes[i].value);
                }
            }
            if (!node.attributes.getNamedItem("id")) {
                this._nodes[node.nodeName + Object.keys(this._nodes).length + "_gen"] = guiNode;
                return guiNode;
            }
            var id = node.attributes.getNamedItem("id").value;
            if (id.startsWith("{{") && id.endsWith("}}")) {
                id = this._getChainElement(id.substring(2, id.length - 2));
            }
            if (!this._nodes[id]) {
                this._nodes[id] = guiNode;
            }
            else {
                throw "XmlLoader Exception : Duplicate ID, every element should have an unique ID attribute";
            }
            return guiNode;
        }
        catch (exception) {
            throw "XmlLoader Exception : Error parsing Control " + node.nodeName + "," + exception + ".";
        }
    };
    XmlLoader.prototype._parseGrid = function (node, guiNode, parent) {
        var width;
        var height;
        var columns;
        var rows = node.children;
        var cells;
        var isPixel = false;
        var cellNode;
        var rowNumber = -1;
        var columnNumber = -1;
        var totalColumnsNumber = 0;
        for (var i = 0; i < rows.length; i++) {
            if (rows[i].nodeType != this._nodeTypes.element) {
                continue;
            }
            if (rows[i].nodeName != "Row") {
                throw "XmlLoader Exception : Expecting Row node, received " + rows[i].nodeName;
            }
            rowNumber += 1;
            columns = rows[i].children;
            if (!rows[i].attributes.getNamedItem("height")) {
                throw "XmlLoader Exception : Height must be defined for grid rows";
            }
            height = Number(rows[i].attributes.getNamedItem("height").nodeValue);
            isPixel = rows[i].attributes.getNamedItem("isPixel") ? JSON.parse(rows[i].attributes.getNamedItem("isPixel").nodeValue) : false;
            guiNode.addRowDefinition(height, isPixel);
            for (var j = 0; j < columns.length; j++) {
                if (columns[j].nodeType != this._nodeTypes.element) {
                    continue;
                }
                if (columns[j].nodeName != "Column") {
                    throw "XmlLoader Exception : Expecting Column node, received " + columns[j].nodeName;
                }
                columnNumber += 1;
                if (rowNumber > 0 && columnNumber > totalColumnsNumber) {
                    throw "XmlLoader Exception : In the Grid element, the number of columns is defined in the first row, do not add more columns in the subsequent rows.";
                }
                if (rowNumber == 0) {
                    if (!columns[j].attributes.getNamedItem("width")) {
                        throw "XmlLoader Exception : Width must be defined for all the grid columns in the first row";
                    }
                    width = Number(columns[j].attributes.getNamedItem("width").nodeValue);
                    isPixel = columns[j].attributes.getNamedItem("isPixel") ? JSON.parse(columns[j].attributes.getNamedItem("isPixel").nodeValue) : false;
                    guiNode.addColumnDefinition(width, isPixel);
                }
                cells = columns[j].children;
                for (var k = 0; k < cells.length; k++) {
                    if (cells[k].nodeType != this._nodeTypes.element) {
                        continue;
                    }
                    cellNode = this._createGuiElement(cells[k], guiNode, false);
                    guiNode.addControl(cellNode, rowNumber, columnNumber);
                    if (cells[k].firstChild) {
                        this._parseXml(cells[k].firstChild, cellNode);
                    }
                }
            }
            if (rowNumber == 0) {
                totalColumnsNumber = columnNumber;
            }
            columnNumber = -1;
        }
        if (node.nextSibling) {
            this._parseXml(node.nextSibling, parent);
        }
    };
    XmlLoader.prototype._parseElement = function (node, guiNode, parent) {
        if (node.firstChild) {
            this._parseXml(node.firstChild, guiNode);
        }
        if (node.nextSibling) {
            this._parseXml(node.nextSibling, parent);
        }
    };
    XmlLoader.prototype._prepareSourceElement = function (node, guiNode, variable, source, iterator) {
        if (this._parentClass) {
            this._parentClass[variable] = source[iterator];
        }
        else {
            window[variable] = source[iterator];
        }
        if (node.firstChild) {
            this._parseXml(node.firstChild, guiNode, true);
        }
    };
    XmlLoader.prototype._parseElementsFromSource = function (node, guiNode, parent) {
        var dataSource = node.attributes.getNamedItem("dataSource").value;
        if (!dataSource.includes(" in ")) {
            throw "XmlLoader Exception : Malformed XML, Data Source must include an in";
        }
        else {
            var isArray = true;
            var splittedSource = dataSource.split(" in ");
            if (splittedSource.length < 2) {
                throw "XmlLoader Exception : Malformed XML, Data Source must have an iterator and a source";
            }
            var source = splittedSource[1];
            if (source.startsWith("{") && source.endsWith("}")) {
                isArray = false;
            }
            if (!isArray || (source.startsWith("[") && source.endsWith("]"))) {
                source = source.substring(1, source.length - 1);
            }
            if (this._parentClass) {
                source = this._parentClass[source];
            }
            else {
                source = window[source];
            }
            if (isArray) {
                for (var i = 0; i < source.length; i++) {
                    this._prepareSourceElement(node, guiNode, splittedSource[0], source, i);
                }
            }
            else {
                for (var i in source) {
                    this._prepareSourceElement(node, guiNode, splittedSource[0], source, i);
                }
            }
            if (node.nextSibling) {
                this._parseXml(node.nextSibling, parent);
            }
        }
    };
    XmlLoader.prototype._parseXml = function (node, parent, generated) {
        if (generated === void 0) { generated = false; }
        if (node.nodeType != this._nodeTypes.element) {
            if (node.nextSibling) {
                this._parseXml(node.nextSibling, parent, generated);
            }
            return;
        }
        if (generated) {
            node.setAttribute("id", parent.id + (parent._children.length + 1));
        }
        var guiNode = this._createGuiElement(node, parent);
        if (!this._rootNode) {
            this._rootNode = guiNode;
        }
        if (node.nodeName == "Grid") {
            this._parseGrid(node, guiNode, parent);
        }
        else if (!node.attributes.getNamedItem("dataSource")) {
            this._parseElement(node, guiNode, parent);
        }
        else {
            this._parseElementsFromSource(node, guiNode, parent);
        }
    };
    /**
     * Gets if the loading has finished.
     * @returns whether the loading has finished or not
     */
    XmlLoader.prototype.isLoaded = function () {
        return this._isLoaded;
    };
    /**
     * Gets a loaded node / control by id.
     * @param id the Controls id set in the xml
     * @returns element of type Control
     */
    XmlLoader.prototype.getNodeById = function (id) {
        return this._nodes[id];
    };
    /**
     * Gets all loaded nodes / controls
     * @returns Array of controls
     */
    XmlLoader.prototype.getNodes = function () {
        return this._nodes;
    };
    /**
     * Disposes the loaded layout
     */
    XmlLoader.prototype.dispose = function () {
        if (this._rootNode) {
            this._rootNode.dispose();
            this._rootNode = null;
            this._nodes = {};
        }
    };
    /**
     * Initiates the xml layout loading
     * @param xmlFile defines the xml layout to load
     * @param rootNode defines the node / control to use as a parent for the loaded layout controls.
     * @param onSuccess defines the callback called on layout load successfully.
     * @param onError defines the callback called on layout load failure.
     */
    XmlLoader.prototype.loadLayout = function (xmlFile, rootNode, onSuccess, onError) {
        var _this = this;
        if (onSuccess === void 0) { onSuccess = null; }
        if (onError === void 0) { onError = null; }
        var xhttp = new XMLHttpRequest();
        xhttp.onload = function () {
            if (xhttp.readyState === 4 && xhttp.status === 200) {
                if (!xhttp.responseXML) {
                    if (onError) {
                        onError(XmlLoaderError);
                        return;
                    }
                    else {
                        throw XmlLoaderError;
                    }
                }
                var xmlDoc = xhttp.responseXML.documentElement;
                _this._parseXml(xmlDoc.firstChild, rootNode);
                _this._isLoaded = true;
                if (onSuccess) {
                    onSuccess();
                }
            }
        };
        xhttp.onerror = function () {
            if (onError) {
                onError("an error occurred during loading the layout");
            }
        };
        xhttp.open("GET", xmlFile, true);
        xhttp.send();
    };
    /**
     * Initiates the xml layout loading asynchronously
     * @param xmlFile defines the xml layout to load
     * @param rootNode defines the node / control to use as a parent for the loaded layout controls.
     * @returns Promise
     */
    XmlLoader.prototype.loadLayoutAsync = function (xmlFile, rootNode) {
        return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__awaiter)(this, void 0, void 0, function () {
            var _this = this;
            return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__generator)(this, function (_a) {
                return [2 /*return*/, new Promise(function (resolve, reject) {
                        _this.loadLayout(xmlFile, rootNode, resolve, reject);
                    })];
            });
        });
    };
    return XmlLoader;
}());



/***/ }),

/***/ "../../../lts/gui/dist/3D/behaviors/defaultBehavior.js":
/*!*************************************************************!*\
  !*** ../../../lts/gui/dist/3D/behaviors/defaultBehavior.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "DefaultBehavior": () => (/* binding */ DefaultBehavior)
/* harmony export */ });
/* harmony import */ var core_Behaviors_Meshes_followBehavior__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Behaviors/Meshes/surfaceMagnetismBehavior */ "core/Misc/observable");
/* harmony import */ var core_Behaviors_Meshes_followBehavior__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_Behaviors_Meshes_followBehavior__WEBPACK_IMPORTED_MODULE_0__);



/**
 * Default behavior for 3D UI elements.
 * Handles a FollowBehavior, SixDofBehavior and SurfaceMagnetismBehavior
 * @since 5.0.0
 */
var DefaultBehavior = /** @class */ (function () {
    /**
     * Instantiates the default behavior
     */
    function DefaultBehavior() {
        /**
         * Enables the follow behavior
         */
        this.followBehaviorEnabled = false;
        /**
         * Enables the six DoF drag behavior
         */
        this.sixDofDragBehaviorEnabled = true;
        /**
         * Enables the surface magnetism behavior
         */
        this.surfaceMagnetismBehaviorEnabled = true;
        this._followBehavior = new core_Behaviors_Meshes_followBehavior__WEBPACK_IMPORTED_MODULE_0__.FollowBehavior();
        this._sixDofDragBehavior = new core_Behaviors_Meshes_followBehavior__WEBPACK_IMPORTED_MODULE_0__.SixDofDragBehavior();
        this._surfaceMagnetismBehavior = new core_Behaviors_Meshes_followBehavior__WEBPACK_IMPORTED_MODULE_0__.SurfaceMagnetismBehavior();
    }
    Object.defineProperty(DefaultBehavior.prototype, "name", {
        /**
         *  The name of the behavior
         */
        get: function () {
            return "Default";
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DefaultBehavior.prototype, "followBehavior", {
        /**
         *  The follow behavior
         */
        get: function () {
            return this._followBehavior;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DefaultBehavior.prototype, "sixDofDragBehavior", {
        /**
         *  The six DoF drag behavior
         */
        get: function () {
            return this._sixDofDragBehavior;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DefaultBehavior.prototype, "surfaceMagnetismBehavior", {
        /**
         * The surface magnetism behavior
         */
        get: function () {
            return this._surfaceMagnetismBehavior;
        },
        enumerable: false,
        configurable: true
    });
    /**
     *  Initializes the behavior
     */
    DefaultBehavior.prototype.init = function () { };
    /**
     * Attaches the default behavior
     * @param ownerMesh The top level mesh
     * @param draggablesMeshes Descendant meshes that can be used for dragging the owner mesh
     * @param sceneUnderstandingMeshes Meshes from the scene understanding that will be used for surface magnetism
     */
    DefaultBehavior.prototype.attach = function (ownerMesh, draggablesMeshes, sceneUnderstandingMeshes) {
        this._scene = ownerMesh.getScene();
        this.attachedNode = ownerMesh;
        this._addObservables();
        // Since our observables are bound before the child behaviors', ours are called first
        this._followBehavior.attach(ownerMesh);
        this._sixDofDragBehavior.attach(ownerMesh);
        this._sixDofDragBehavior.draggableMeshes = draggablesMeshes || null;
        this._sixDofDragBehavior.faceCameraOnDragStart = true;
        this._surfaceMagnetismBehavior.attach(ownerMesh, this._scene);
        if (sceneUnderstandingMeshes) {
            this._surfaceMagnetismBehavior.meshes = sceneUnderstandingMeshes;
        }
        // We disable this behavior because we will handle pose changing event manually with sixDofDragBehavior
        this._surfaceMagnetismBehavior.enabled = false;
    };
    /**
     *  Detaches the behavior from the mesh
     */
    DefaultBehavior.prototype.detach = function () {
        this.attachedNode = null;
        this._removeObservables();
        this._followBehavior.detach();
        this._sixDofDragBehavior.detach();
        this._surfaceMagnetismBehavior.detach();
    };
    DefaultBehavior.prototype._addObservables = function () {
        var _this = this;
        this._onBeforeRenderObserver = this._scene.onBeforeRenderObservable.add(function () {
            _this._followBehavior._enabled = !_this._sixDofDragBehavior.isMoving && _this.followBehaviorEnabled;
        });
        this._onDragObserver = this._sixDofDragBehavior.onDragObservable.add(function (event) {
            _this._sixDofDragBehavior.disableMovement = _this._surfaceMagnetismBehavior.findAndUpdateTarget(event.pickInfo);
        });
    };
    DefaultBehavior.prototype._removeObservables = function () {
        this._scene.onBeforeRenderObservable.remove(this._onBeforeRenderObserver);
        this._sixDofDragBehavior.onDragObservable.remove(this._onDragObserver);
    };
    return DefaultBehavior;
}());



/***/ }),

/***/ "../../../lts/gui/dist/3D/controls/abstractButton3D.js":
/*!*************************************************************!*\
  !*** ../../../lts/gui/dist/3D/controls/abstractButton3D.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "AbstractButton3D": () => (/* binding */ AbstractButton3D)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Meshes_transformNode__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Meshes/transformNode */ "core/Misc/observable");
/* harmony import */ var core_Meshes_transformNode__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Meshes_transformNode__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _contentDisplay3D__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./contentDisplay3D */ "../../../lts/gui/dist/3D/controls/contentDisplay3D.js");



/**
 * Class used as a root to all buttons
 */
var AbstractButton3D = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(AbstractButton3D, _super);
    /**
     * Creates a new button
     * @param name defines the control name
     */
    function AbstractButton3D(name) {
        return _super.call(this, name) || this;
    }
    AbstractButton3D.prototype._getTypeName = function () {
        return "AbstractButton3D";
    };
    // Mesh association
    AbstractButton3D.prototype._createNode = function (scene) {
        return new core_Meshes_transformNode__WEBPACK_IMPORTED_MODULE_1__.TransformNode("button" + this.name, scene);
    };
    return AbstractButton3D;
}(_contentDisplay3D__WEBPACK_IMPORTED_MODULE_2__.ContentDisplay3D));



/***/ }),

/***/ "../../../lts/gui/dist/3D/controls/button3D.js":
/*!*****************************************************!*\
  !*** ../../../lts/gui/dist/3D/controls/button3D.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Button3D": () => (/* binding */ Button3D)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Maths/math.color */ "core/Misc/observable");
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _abstractButton3D__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./abstractButton3D */ "../../../lts/gui/dist/3D/controls/abstractButton3D.js");






/**
 * Class used to create a button in 3D
 */
var Button3D = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(Button3D, _super);
    /**
     * Creates a new button
     * @param name defines the control name
     */
    function Button3D(name) {
        var _this = _super.call(this, name) || this;
        // Default animations
        _this.pointerEnterAnimation = function () {
            if (!_this.mesh) {
                return;
            }
            _this._currentMaterial.emissiveColor = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Color3.Red();
        };
        _this.pointerOutAnimation = function () {
            _this._currentMaterial.emissiveColor = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Color3.Black();
        };
        _this.pointerDownAnimation = function () {
            if (!_this.mesh) {
                return;
            }
            _this.mesh.scaling.scaleInPlace(0.95);
        };
        _this.pointerUpAnimation = function () {
            if (!_this.mesh) {
                return;
            }
            _this.mesh.scaling.scaleInPlace(1.0 / 0.95);
        };
        return _this;
    }
    /**
     * Apply the facade texture (created from the content property).
     * @param facadeTexture defines the AdvancedDynamicTexture to use
     */
    Button3D.prototype._applyFacade = function (facadeTexture) {
        this._currentMaterial.emissiveTexture = facadeTexture;
    };
    Button3D.prototype._getTypeName = function () {
        return "Button3D";
    };
    // Mesh association
    Button3D.prototype._createNode = function (scene) {
        var faceUV = new Array(6);
        for (var i = 0; i < 6; i++) {
            faceUV[i] = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Vector4(0, 0, 0, 0);
        }
        if (scene.useRightHandedSystem) {
            // Flip the u on the texture
            faceUV[0].copyFromFloats(1, 0, 0, 1);
        }
        else {
            faceUV[1].copyFromFloats(0, 0, 1, 1);
        }
        var mesh = (0,core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.CreateBox)(this.name + "_rootMesh", {
            width: 1.0,
            height: 1.0,
            depth: 0.08,
            faceUV: faceUV,
            wrap: true,
        }, scene);
        return mesh;
    };
    Button3D.prototype._affectMaterial = function (mesh) {
        var material = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.StandardMaterial(this.name + "Material", mesh.getScene());
        material.specularColor = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Color3.Black();
        mesh.material = material;
        this._currentMaterial = material;
        this._resetContent();
    };
    /**
     * Releases all associated resources
     */
    Button3D.prototype.dispose = function () {
        _super.prototype.dispose.call(this);
        this._disposeFacadeTexture();
        if (this._currentMaterial) {
            this._currentMaterial.dispose();
        }
    };
    return Button3D;
}(_abstractButton3D__WEBPACK_IMPORTED_MODULE_2__.AbstractButton3D));



/***/ }),

/***/ "../../../lts/gui/dist/3D/controls/container3D.js":
/*!********************************************************!*\
  !*** ../../../lts/gui/dist/3D/controls/container3D.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Container3D": () => (/* binding */ Container3D)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Meshes_transformNode__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Meshes/transformNode */ "core/Misc/observable");
/* harmony import */ var core_Meshes_transformNode__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Meshes_transformNode__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _control3D__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./control3D */ "../../../lts/gui/dist/3D/controls/control3D.js");



/**
 * Class used to create containers for controls
 */
var Container3D = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(Container3D, _super);
    /**
     * Creates a new container
     * @param name defines the container name
     */
    function Container3D(name) {
        var _this = _super.call(this, name) || this;
        _this._blockLayout = false;
        /**
         * Gets the list of child controls
         */
        _this._children = new Array();
        return _this;
    }
    Object.defineProperty(Container3D.prototype, "children", {
        /**
         * Gets the list of child controls
         */
        get: function () {
            return this._children;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Container3D.prototype, "blockLayout", {
        /**
         * Gets or sets a boolean indicating if the layout must be blocked (default is false).
         * This is helpful to optimize layout operation when adding multiple children in a row
         */
        get: function () {
            return this._blockLayout;
        },
        set: function (value) {
            if (this._blockLayout === value) {
                return;
            }
            this._blockLayout = value;
            if (!this._blockLayout) {
                this._arrangeChildren();
            }
        },
        enumerable: false,
        configurable: true
    });
    /**
     * Force the container to update the layout. Please note that it will not take blockLayout property in account
     * @returns the current container
     */
    Container3D.prototype.updateLayout = function () {
        this._arrangeChildren();
        return this;
    };
    /**
     * Gets a boolean indicating if the given control is in the children of this control
     * @param control defines the control to check
     * @returns true if the control is in the child list
     */
    Container3D.prototype.containsControl = function (control) {
        return this._children.indexOf(control) !== -1;
    };
    /**
     * Adds a control to the children of this control
     * @param control defines the control to add
     * @returns the current container
     */
    Container3D.prototype.addControl = function (control) {
        var index = this._children.indexOf(control);
        if (index !== -1) {
            return this;
        }
        control.parent = this;
        control._host = this._host;
        this._children.push(control);
        if (this._host.utilityLayer) {
            control._prepareNode(this._host.utilityLayer.utilityLayerScene);
            if (control.node) {
                control.node.parent = this.node;
            }
            if (!this.blockLayout) {
                this._arrangeChildren();
            }
        }
        return this;
    };
    /**
     * This function will be called everytime a new control is added
     */
    Container3D.prototype._arrangeChildren = function () { };
    Container3D.prototype._createNode = function (scene) {
        return new core_Meshes_transformNode__WEBPACK_IMPORTED_MODULE_1__.TransformNode("ContainerNode", scene);
    };
    /**
     * Removes a control from the children of this control
     * @param control defines the control to remove
     * @returns the current container
     */
    Container3D.prototype.removeControl = function (control) {
        var index = this._children.indexOf(control);
        if (index !== -1) {
            this._children.splice(index, 1);
            control.parent = null;
            control._disposeNode();
        }
        return this;
    };
    Container3D.prototype._getTypeName = function () {
        return "Container3D";
    };
    /**
     * Releases all associated resources
     */
    Container3D.prototype.dispose = function () {
        for (var _i = 0, _a = this._children; _i < _a.length; _i++) {
            var control = _a[_i];
            control.dispose();
        }
        this._children = [];
        _super.prototype.dispose.call(this);
    };
    /** Control rotation will remain unchanged  */
    Container3D.UNSET_ORIENTATION = 0;
    /** Control will rotate to make it look at sphere central axis */
    Container3D.FACEORIGIN_ORIENTATION = 1;
    /** Control will rotate to make it look back at sphere central axis */
    Container3D.FACEORIGINREVERSED_ORIENTATION = 2;
    /** Control will rotate to look at z axis (0, 0, 1) */
    Container3D.FACEFORWARD_ORIENTATION = 3;
    /** Control will rotate to look at negative z axis (0, 0, -1) */
    Container3D.FACEFORWARDREVERSED_ORIENTATION = 4;
    return Container3D;
}(_control3D__WEBPACK_IMPORTED_MODULE_2__.Control3D));



/***/ }),

/***/ "../../../lts/gui/dist/3D/controls/contentDisplay3D.js":
/*!*************************************************************!*\
  !*** ../../../lts/gui/dist/3D/controls/contentDisplay3D.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "ContentDisplay3D": () => (/* binding */ ContentDisplay3D)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var _2D_advancedDynamicTexture__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../2D/advancedDynamicTexture */ "../../../lts/gui/dist/2D/advancedDynamicTexture.js");
/* harmony import */ var _control3D__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./control3D */ "../../../lts/gui/dist/3D/controls/control3D.js");
/* harmony import */ var core_Materials_Textures_texture__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core/Materials/Textures/texture */ "core/Misc/observable");
/* harmony import */ var core_Materials_Textures_texture__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_Materials_Textures_texture__WEBPACK_IMPORTED_MODULE_3__);




/**
 * The base class for controls that display content
 */
var ContentDisplay3D = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(ContentDisplay3D, _super);
    function ContentDisplay3D() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this._contentResolution = 512;
        _this._contentScaleRatio = 2;
        return _this;
    }
    Object.defineProperty(ContentDisplay3D.prototype, "content", {
        /**
         * Gets or sets the GUI 2D content used to display the button's facade
         */
        get: function () {
            return this._content;
        },
        set: function (value) {
            this._content = value;
            if (!value || !this._host || !this._host.utilityLayer) {
                return;
            }
            if (!this._facadeTexture) {
                this._facadeTexture = new _2D_advancedDynamicTexture__WEBPACK_IMPORTED_MODULE_1__.AdvancedDynamicTexture("Facade", this._contentResolution, this._contentResolution, this._host.utilityLayer.utilityLayerScene, true, core_Materials_Textures_texture__WEBPACK_IMPORTED_MODULE_3__.Texture.TRILINEAR_SAMPLINGMODE);
                this._facadeTexture.rootContainer.scaleX = this._contentScaleRatio;
                this._facadeTexture.rootContainer.scaleY = this._contentScaleRatio;
                this._facadeTexture.premulAlpha = true;
            }
            else {
                this._facadeTexture.rootContainer.clearControls();
            }
            this._facadeTexture.addControl(value);
            this._applyFacade(this._facadeTexture);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ContentDisplay3D.prototype, "contentResolution", {
        /**
         * Gets or sets the texture resolution used to render content (512 by default)
         */
        get: function () {
            return this._contentResolution;
        },
        set: function (value) {
            if (this._contentResolution === value) {
                return;
            }
            this._contentResolution = value;
            this._resetContent();
        },
        enumerable: false,
        configurable: true
    });
    ContentDisplay3D.prototype._disposeFacadeTexture = function () {
        if (this._facadeTexture) {
            this._facadeTexture.dispose();
            this._facadeTexture = null;
        }
    };
    ContentDisplay3D.prototype._resetContent = function () {
        this._disposeFacadeTexture();
        this.content = this._content;
    };
    /**
     * Apply the facade texture (created from the content property).
     * This function can be overloaded by child classes
     * @param facadeTexture defines the AdvancedDynamicTexture to use
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    ContentDisplay3D.prototype._applyFacade = function (facadeTexture) { };
    return ContentDisplay3D;
}(_control3D__WEBPACK_IMPORTED_MODULE_2__.Control3D));



/***/ }),

/***/ "../../../lts/gui/dist/3D/controls/control3D.js":
/*!******************************************************!*\
  !*** ../../../lts/gui/dist/3D/controls/control3D.js ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Control3D": () => (/* binding */ Control3D)
/* harmony export */ });
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Meshes/abstractMesh */ "core/Misc/observable");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _vector3WithInfo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../vector3WithInfo */ "../../../lts/gui/dist/3D/vector3WithInfo.js");





/**
 * Class used as base class for controls
 */
var Control3D = /** @class */ (function () {
    /**
     * Creates a new control
     * @param name defines the control name
     */
    function Control3D(
    /** Defines the control name */
    name) {
        this.name = name;
        this._downCount = 0;
        this._enterCount = -1;
        this._downPointerIds = {}; // Store number of pointer downs per ID, from near and far interactions
        this._isVisible = true;
        /** @hidden */
        this._isScaledByManager = false;
        /**
         * An event triggered when the pointer moves over the control
         */
        this.onPointerMoveObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        /**
         * An event triggered when the pointer moves out of the control
         */
        this.onPointerOutObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        /**
         * An event triggered when the pointer taps the control
         */
        this.onPointerDownObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        /**
         * An event triggered when pointer is up
         */
        this.onPointerUpObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        /**
         * An event triggered when a control is clicked on (with a mouse)
         */
        this.onPointerClickObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        /**
         * An event triggered when pointer enters the control
         */
        this.onPointerEnterObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        // Behaviors
        this._behaviors = new Array();
    }
    Object.defineProperty(Control3D.prototype, "position", {
        /** Gets or sets the control position in world space */
        get: function () {
            if (!this._node) {
                return core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Vector3.Zero();
            }
            return this._node.position;
        },
        set: function (value) {
            if (!this._node) {
                return;
            }
            this._node.position = value;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control3D.prototype, "scaling", {
        /** Gets or sets the control scaling in world space */
        get: function () {
            if (!this._node) {
                return new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Vector3(1, 1, 1);
            }
            return this._node.scaling;
        },
        set: function (value) {
            if (!this._node) {
                return;
            }
            this._isScaledByManager = false;
            this._node.scaling = value;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control3D.prototype, "behaviors", {
        /**
         * Gets the list of attached behaviors
         * @see https://doc.babylonjs.com/features/behaviour
         */
        get: function () {
            return this._behaviors;
        },
        enumerable: false,
        configurable: true
    });
    /**
     * Attach a behavior to the control
     * @see https://doc.babylonjs.com/features/behaviour
     * @param behavior defines the behavior to attach
     * @returns the current control
     */
    Control3D.prototype.addBehavior = function (behavior) {
        var _this = this;
        var index = this._behaviors.indexOf(behavior);
        if (index !== -1) {
            return this;
        }
        behavior.init();
        var scene = this._host.scene;
        if (scene.isLoading) {
            // We defer the attach when the scene will be loaded
            scene.onDataLoadedObservable.addOnce(function () {
                behavior.attach(_this);
            });
        }
        else {
            behavior.attach(this);
        }
        this._behaviors.push(behavior);
        return this;
    };
    /**
     * Remove an attached behavior
     * @see https://doc.babylonjs.com/features/behaviour
     * @param behavior defines the behavior to attach
     * @returns the current control
     */
    Control3D.prototype.removeBehavior = function (behavior) {
        var index = this._behaviors.indexOf(behavior);
        if (index === -1) {
            return this;
        }
        this._behaviors[index].detach();
        this._behaviors.splice(index, 1);
        return this;
    };
    /**
     * Gets an attached behavior by name
     * @param name defines the name of the behavior to look for
     * @see https://doc.babylonjs.com/features/behaviour
     * @returns null if behavior was not found else the requested behavior
     */
    Control3D.prototype.getBehaviorByName = function (name) {
        for (var _i = 0, _a = this._behaviors; _i < _a.length; _i++) {
            var behavior = _a[_i];
            if (behavior.name === name) {
                return behavior;
            }
        }
        return null;
    };
    Object.defineProperty(Control3D.prototype, "isVisible", {
        /** Gets or sets a boolean indicating if the control is visible */
        get: function () {
            return this._isVisible;
        },
        set: function (value) {
            if (this._isVisible === value) {
                return;
            }
            this._isVisible = value;
            var mesh = this.mesh;
            if (mesh) {
                mesh.setEnabled(value);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control3D.prototype, "typeName", {
        /**
         * Gets a string representing the class name
         */
        get: function () {
            return this._getTypeName();
        },
        enumerable: false,
        configurable: true
    });
    /**
     * Get the current class name of the control.
     * @returns current class name
     */
    Control3D.prototype.getClassName = function () {
        return this._getTypeName();
    };
    Control3D.prototype._getTypeName = function () {
        return "Control3D";
    };
    Object.defineProperty(Control3D.prototype, "node", {
        /**
         * Gets the transform node used by this control
         */
        get: function () {
            return this._node;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Control3D.prototype, "mesh", {
        /**
         * Gets the mesh used to render this control
         */
        get: function () {
            if (this._node instanceof core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.AbstractMesh) {
                return this._node;
            }
            return null;
        },
        enumerable: false,
        configurable: true
    });
    /**
     * Link the control as child of the given node
     * @param node defines the node to link to. Use null to unlink the control
     * @returns the current control
     */
    Control3D.prototype.linkToTransformNode = function (node) {
        if (this._node) {
            this._node.parent = node;
        }
        return this;
    };
    /**
     * @param scene
     * @hidden*
     */
    Control3D.prototype._prepareNode = function (scene) {
        if (!this._node) {
            this._node = this._createNode(scene);
            if (!this.node) {
                return;
            }
            this._injectGUI3DReservedDataStore(this.node).control = this; // Store the control on the reservedDataStore field in order to get it when picking
            var mesh = this.mesh;
            if (mesh) {
                mesh.isPickable = true;
                this._affectMaterial(mesh);
            }
        }
    };
    Control3D.prototype._injectGUI3DReservedDataStore = function (node) {
        var _a, _b;
        node.reservedDataStore = (_a = node.reservedDataStore) !== null && _a !== void 0 ? _a : {};
        node.reservedDataStore.GUI3D = (_b = node.reservedDataStore.GUI3D) !== null && _b !== void 0 ? _b : {};
        return node.reservedDataStore.GUI3D;
    };
    /**
     * Node creation.
     * Can be overriden by children
     * @param scene defines the scene where the node must be attached
     * @returns the attached node or null if none. Must return a Mesh or AbstractMesh if there is an attached visible object
     */
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    Control3D.prototype._createNode = function (scene) {
        // Do nothing by default
        return null;
    };
    /**
     * Affect a material to the given mesh
     * @param mesh defines the mesh which will represent the control
     */
    Control3D.prototype._affectMaterial = function (mesh) {
        mesh.material = null;
    };
    Control3D.prototype._isTouchButton3D = function (control) {
        return control._generatePointerEventType !== undefined;
    };
    // Pointers
    /**
     * @param target
     * @param coordinates
     * @hidden
     */
    Control3D.prototype._onPointerMove = function (target, coordinates) {
        this.onPointerMoveObservable.notifyObservers(coordinates, -1, target, this);
    };
    /**
     * @param target
     * @hidden
     */
    Control3D.prototype._onPointerEnter = function (target) {
        if (this._enterCount === -1) {
            // -1 is for touch input, we are now sure we are with a mouse or pencil
            this._enterCount = 0;
        }
        this._enterCount++;
        if (this._enterCount > 1) {
            return false;
        }
        this.onPointerEnterObservable.notifyObservers(this, -1, target, this);
        if (this.pointerEnterAnimation) {
            this.pointerEnterAnimation();
        }
        return true;
    };
    /**
     * @param target
     * @hidden
     */
    Control3D.prototype._onPointerOut = function (target) {
        this._enterCount--;
        if (this._enterCount > 0) {
            return;
        }
        this._enterCount = 0;
        this.onPointerOutObservable.notifyObservers(this, -1, target, this);
        if (this.pointerOutAnimation) {
            this.pointerOutAnimation();
        }
    };
    /**
     * @param target
     * @param coordinates
     * @param pointerId
     * @param buttonIndex
     * @hidden
     */
    Control3D.prototype._onPointerDown = function (target, coordinates, pointerId, buttonIndex) {
        this._downCount++;
        this._downPointerIds[pointerId] = this._downPointerIds[pointerId] + 1 || 1;
        if (this._downCount !== 1) {
            return false;
        }
        this.onPointerDownObservable.notifyObservers(new _vector3WithInfo__WEBPACK_IMPORTED_MODULE_1__.Vector3WithInfo(coordinates, buttonIndex), -1, target, this);
        if (this.pointerDownAnimation) {
            this.pointerDownAnimation();
        }
        return true;
    };
    /**
     * @param target
     * @param coordinates
     * @param pointerId
     * @param buttonIndex
     * @param notifyClick
     * @hidden
     */
    Control3D.prototype._onPointerUp = function (target, coordinates, pointerId, buttonIndex, notifyClick) {
        this._downCount--;
        this._downPointerIds[pointerId]--;
        if (this._downPointerIds[pointerId] <= 0) {
            delete this._downPointerIds[pointerId];
        }
        if (this._downCount < 0) {
            // Handle if forcePointerUp was called prior to this
            this._downCount = 0;
            return;
        }
        if (this._downCount == 0) {
            if (notifyClick && (this._enterCount > 0 || this._enterCount === -1)) {
                this.onPointerClickObservable.notifyObservers(new _vector3WithInfo__WEBPACK_IMPORTED_MODULE_1__.Vector3WithInfo(coordinates, buttonIndex), -1, target, this);
            }
            this.onPointerUpObservable.notifyObservers(new _vector3WithInfo__WEBPACK_IMPORTED_MODULE_1__.Vector3WithInfo(coordinates, buttonIndex), -1, target, this);
            if (this.pointerUpAnimation) {
                this.pointerUpAnimation();
            }
        }
    };
    /**
     * @param pointerId
     * @hidden
     */
    Control3D.prototype.forcePointerUp = function (pointerId) {
        if (pointerId === void 0) { pointerId = null; }
        if (pointerId !== null) {
            this._onPointerUp(this, core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Vector3.Zero(), pointerId, 0, true);
        }
        else {
            for (var key in this._downPointerIds) {
                this._onPointerUp(this, core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Vector3.Zero(), +key, 0, true);
            }
            if (this._downCount > 0) {
                this._downCount = 1;
                this._onPointerUp(this, core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Vector3.Zero(), 0, 0, true);
            }
        }
    };
    /**
     * @param type
     * @param pickedPoint
     * @param originMeshPosition
     * @param pointerId
     * @param buttonIndex
     * @hidden
     */
    Control3D.prototype._processObservables = function (type, pickedPoint, originMeshPosition, pointerId, buttonIndex) {
        if (this._isTouchButton3D(this) && originMeshPosition) {
            type = this._generatePointerEventType(type, originMeshPosition, this._downCount);
        }
        if (type === core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.PointerEventTypes.POINTERMOVE) {
            this._onPointerMove(this, pickedPoint);
            var previousControlOver = this._host._lastControlOver[pointerId];
            if (previousControlOver && previousControlOver !== this) {
                previousControlOver._onPointerOut(this);
            }
            if (previousControlOver !== this) {
                this._onPointerEnter(this);
            }
            this._host._lastControlOver[pointerId] = this;
            return true;
        }
        if (type === core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.PointerEventTypes.POINTERDOWN) {
            this._onPointerDown(this, pickedPoint, pointerId, buttonIndex);
            this._host._lastControlDown[pointerId] = this;
            this._host._lastPickedControl = this;
            return true;
        }
        if (type === core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.PointerEventTypes.POINTERUP || type === core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.PointerEventTypes.POINTERDOUBLETAP) {
            if (this._host._lastControlDown[pointerId]) {
                this._host._lastControlDown[pointerId]._onPointerUp(this, pickedPoint, pointerId, buttonIndex, true);
            }
            delete this._host._lastControlDown[pointerId];
            return true;
        }
        return false;
    };
    /** @hidden */
    Control3D.prototype._disposeNode = function () {
        if (this._node) {
            this._node.dispose();
            this._node = null;
        }
    };
    /**
     * Releases all associated resources
     */
    Control3D.prototype.dispose = function () {
        this.onPointerDownObservable.clear();
        this.onPointerEnterObservable.clear();
        this.onPointerMoveObservable.clear();
        this.onPointerOutObservable.clear();
        this.onPointerUpObservable.clear();
        this.onPointerClickObservable.clear();
        this._disposeNode();
        // Behaviors
        for (var _i = 0, _a = this._behaviors; _i < _a.length; _i++) {
            var behavior = _a[_i];
            behavior.detach();
        }
    };
    return Control3D;
}());



/***/ }),

/***/ "../../../lts/gui/dist/3D/controls/cylinderPanel.js":
/*!**********************************************************!*\
  !*** ../../../lts/gui/dist/3D/controls/cylinderPanel.js ***!
  \**********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "CylinderPanel": () => (/* binding */ CylinderPanel)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Maths/math.axis */ "core/Misc/observable");
/* harmony import */ var core_Misc_tools__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _volumeBasedPanel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./volumeBasedPanel */ "../../../lts/gui/dist/3D/controls/volumeBasedPanel.js");
/* harmony import */ var _container3D__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./container3D */ "../../../lts/gui/dist/3D/controls/container3D.js");






/**
 * Class used to create a container panel deployed on the surface of a cylinder
 */
var CylinderPanel = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(CylinderPanel, _super);
    function CylinderPanel() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this._radius = 5.0;
        return _this;
    }
    Object.defineProperty(CylinderPanel.prototype, "radius", {
        /**
         * Gets or sets the radius of the cylinder where to project controls (5 by default)
         */
        get: function () {
            return this._radius;
        },
        set: function (value) {
            var _this = this;
            if (this._radius === value) {
                return;
            }
            this._radius = value;
            core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.Tools.SetImmediate(function () {
                _this._arrangeChildren();
            });
        },
        enumerable: false,
        configurable: true
    });
    CylinderPanel.prototype._mapGridNode = function (control, nodePosition) {
        var mesh = control.mesh;
        if (!mesh) {
            return;
        }
        var newPos = this._cylindricalMapping(nodePosition);
        control.position = newPos;
        switch (this.orientation) {
            case _container3D__WEBPACK_IMPORTED_MODULE_3__.Container3D.FACEORIGIN_ORIENTATION:
                mesh.lookAt(new core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.Vector3(2 * newPos.x, newPos.y, 2 * newPos.z));
                break;
            case _container3D__WEBPACK_IMPORTED_MODULE_3__.Container3D.FACEORIGINREVERSED_ORIENTATION:
                mesh.lookAt(new core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.Vector3(-newPos.x, newPos.y, -newPos.z));
                break;
            case _container3D__WEBPACK_IMPORTED_MODULE_3__.Container3D.FACEFORWARD_ORIENTATION:
                break;
            case _container3D__WEBPACK_IMPORTED_MODULE_3__.Container3D.FACEFORWARDREVERSED_ORIENTATION:
                mesh.rotate(core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.Axis.Y, Math.PI, core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.Space.LOCAL);
                break;
        }
    };
    CylinderPanel.prototype._cylindricalMapping = function (source) {
        var newPos = new core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.Vector3(0, source.y, this._radius);
        var yAngle = source.x / this._radius;
        core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.Matrix.RotationYawPitchRollToRef(yAngle, 0, 0, core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.TmpVectors.Matrix[0]);
        return core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.Vector3.TransformNormal(newPos, core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.TmpVectors.Matrix[0]);
    };
    return CylinderPanel;
}(_volumeBasedPanel__WEBPACK_IMPORTED_MODULE_2__.VolumeBasedPanel));



/***/ }),

/***/ "../../../lts/gui/dist/3D/controls/handMenu.js":
/*!*****************************************************!*\
  !*** ../../../lts/gui/dist/3D/controls/handMenu.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "HandMenu": () => (/* binding */ HandMenu)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var _touchHolographicMenu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./touchHolographicMenu */ "../../../lts/gui/dist/3D/controls/touchHolographicMenu.js");
/* harmony import */ var core_Behaviors_Meshes_handConstraintBehavior__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core/Behaviors/Meshes/handConstraintBehavior */ "core/Misc/observable");
/* harmony import */ var core_Behaviors_Meshes_handConstraintBehavior__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_Behaviors_Meshes_handConstraintBehavior__WEBPACK_IMPORTED_MODULE_2__);



/**
 * Hand menu that displays buttons and floats around the hand.
 * @since 5.0.0
 */
var HandMenu = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(HandMenu, _super);
    /**
     * Creates a hand menu GUI 3D control
     * @param xr the WebXRExperienceHelper used to link this control to the enabled WebXRHandTracking feature
     * @param name name of the hand menu
     */
    function HandMenu(xr, name) {
        var _this = _super.call(this, name) || this;
        _this._handConstraintBehavior = new core_Behaviors_Meshes_handConstraintBehavior__WEBPACK_IMPORTED_MODULE_2__.HandConstraintBehavior();
        _this._handConstraintBehavior.linkToXRExperience(xr);
        _this.backPlateMargin = 0.15;
        _this.rows = 3;
        return _this;
    }
    Object.defineProperty(HandMenu.prototype, "handConstraintBehavior", {
        /**
         * The hand constraint behavior setting the transformation of this node
         */
        get: function () {
            return this._handConstraintBehavior;
        },
        enumerable: false,
        configurable: true
    });
    HandMenu.prototype._createNode = function (scene) {
        var node = _super.prototype._createNode.call(this, scene);
        this._handConstraintBehavior.attach(node);
        return node;
    };
    /**
     * Disposes the hand menu
     */
    HandMenu.prototype.dispose = function () {
        _super.prototype.dispose.call(this);
        this._handConstraintBehavior.detach();
    };
    return HandMenu;
}(_touchHolographicMenu__WEBPACK_IMPORTED_MODULE_1__.TouchHolographicMenu));



/***/ }),

/***/ "../../../lts/gui/dist/3D/controls/holographicBackplate.js":
/*!*****************************************************************!*\
  !*** ../../../lts/gui/dist/3D/controls/holographicBackplate.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "HolographicBackplate": () => (/* binding */ HolographicBackplate)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Meshes_Builders_boxBuilder__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Loading/sceneLoader */ "core/Misc/observable");
/* harmony import */ var core_Meshes_Builders_boxBuilder__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Meshes_Builders_boxBuilder__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _materials_fluentBackplate_fluentBackplateMaterial__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../materials/fluentBackplate/fluentBackplateMaterial */ "../../../lts/gui/dist/3D/materials/fluentBackplate/fluentBackplateMaterial.js");
/* harmony import */ var _control3D__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./control3D */ "../../../lts/gui/dist/3D/controls/control3D.js");





/**
 * Class used to create a holographic backplate in 3D
 * @since 5.0.0
 */
var HolographicBackplate = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(HolographicBackplate, _super);
    /**
     * Creates a new holographic backplate
     * @param name defines the control name
     * @param _shareMaterials
     */
    function HolographicBackplate(name, _shareMaterials) {
        if (_shareMaterials === void 0) { _shareMaterials = true; }
        var _this = _super.call(this, name) || this;
        _this._shareMaterials = _shareMaterials;
        return _this;
    }
    Object.defineProperty(HolographicBackplate.prototype, "renderingGroupId", {
        get: function () {
            return this._model.renderingGroupId;
        },
        /**
         * Rendering ground id of the backplate mesh.
         */
        set: function (id) {
            this._model.renderingGroupId = id;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(HolographicBackplate.prototype, "material", {
        /**
         * Gets the material used by the backplate
         */
        get: function () {
            return this._material;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(HolographicBackplate.prototype, "shareMaterials", {
        /**
         * Gets a boolean indicating if this backplate shares its material with other HolographicBackplates
         */
        get: function () {
            return this._shareMaterials;
        },
        enumerable: false,
        configurable: true
    });
    HolographicBackplate.prototype._getTypeName = function () {
        return "HolographicBackplate";
    };
    // Mesh association
    HolographicBackplate.prototype._createNode = function (scene) {
        var _this = this;
        var _a;
        var collisionMesh = (0,core_Meshes_Builders_boxBuilder__WEBPACK_IMPORTED_MODULE_1__.CreateBox)(((_a = this.name) !== null && _a !== void 0 ? _a : "HolographicBackplate") + "_CollisionMesh", {
            width: 1.0,
            height: 1.0,
            depth: 1.0,
        }, scene);
        collisionMesh.isPickable = true;
        collisionMesh.visibility = 0;
        core_Meshes_Builders_boxBuilder__WEBPACK_IMPORTED_MODULE_1__.SceneLoader.ImportMeshAsync(undefined, HolographicBackplate.MODEL_BASE_URL, HolographicBackplate.MODEL_FILENAME, scene).then(function (result) {
            var importedModel = result.meshes[1];
            importedModel.name = "".concat(_this.name, "_frontPlate");
            importedModel.isPickable = false;
            importedModel.parent = collisionMesh;
            if (_this._material) {
                importedModel.material = _this._material;
            }
            _this._model = importedModel;
        });
        return collisionMesh;
    };
    HolographicBackplate.prototype._createMaterial = function (mesh) {
        this._material = new _materials_fluentBackplate_fluentBackplateMaterial__WEBPACK_IMPORTED_MODULE_2__.FluentBackplateMaterial(this.name + " Material", mesh.getScene());
    };
    HolographicBackplate.prototype._affectMaterial = function (mesh) {
        // Back
        if (this._shareMaterials) {
            if (!this._host._touchSharedMaterials["fluentBackplateMaterial"]) {
                this._createMaterial(mesh);
                this._host._touchSharedMaterials["fluentBackplateMaterial"] = this._material;
            }
            else {
                this._material = this._host._touchSharedMaterials["fluentBackplateMaterial"];
            }
        }
        else {
            this._createMaterial(mesh);
        }
    };
    /**
     * Releases all associated resources
     */
    HolographicBackplate.prototype.dispose = function () {
        _super.prototype.dispose.call(this); // will dispose main mesh ie. back plate
        if (!this.shareMaterials) {
            this._material.dispose();
        }
        this._model.dispose();
    };
    /**
     * Base Url for the button model.
     */
    HolographicBackplate.MODEL_BASE_URL = "https://assets.babylonjs.com/meshes/MRTK/";
    /**
     * File name for the button model.
     */
    HolographicBackplate.MODEL_FILENAME = "mrtk-fluent-backplate.glb";
    return HolographicBackplate;
}(_control3D__WEBPACK_IMPORTED_MODULE_3__.Control3D));



/***/ }),

/***/ "../../../lts/gui/dist/3D/controls/holographicButton.js":
/*!**************************************************************!*\
  !*** ../../../lts/gui/dist/3D/controls/holographicButton.js ***!
  \**************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "HolographicButton": () => (/* binding */ HolographicButton)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var _button3D__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./button3D */ "../../../lts/gui/dist/3D/controls/button3D.js");
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core/Misc/domManagement */ "core/Misc/observable");
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _materials_fluent_fluentMaterial__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../materials/fluent/fluentMaterial */ "../../../lts/gui/dist/3D/materials/fluent/fluentMaterial.js");
/* harmony import */ var _2D_controls_stackPanel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../2D/controls/stackPanel */ "../../../lts/gui/dist/2D/controls/stackPanel.js");
/* harmony import */ var _2D_controls_image__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../2D/controls/image */ "../../../lts/gui/dist/2D/controls/image.js");
/* harmony import */ var _2D_controls_textBlock__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../2D/controls/textBlock */ "../../../lts/gui/dist/2D/controls/textBlock.js");
/* harmony import */ var _2D_advancedDynamicTexture__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../2D/advancedDynamicTexture */ "../../../lts/gui/dist/2D/advancedDynamicTexture.js");















/**
 * Class used to create a holographic button in 3D
 */
var HolographicButton = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(HolographicButton, _super);
    /**
     * Creates a new button
     * @param name defines the control name
     * @param shareMaterials
     */
    function HolographicButton(name, shareMaterials) {
        if (shareMaterials === void 0) { shareMaterials = true; }
        var _this = _super.call(this, name) || this;
        _this._shareMaterials = true;
        _this._shareMaterials = shareMaterials;
        // Default animations
        _this.pointerEnterAnimation = function () {
            if (!_this.mesh) {
                return;
            }
            _this._frontPlate.setEnabled(true);
        };
        _this.pointerOutAnimation = function () {
            if (!_this.mesh) {
                return;
            }
            _this._frontPlate.setEnabled(false);
        };
        return _this;
    }
    HolographicButton.prototype._disposeTooltip = function () {
        this._tooltipFade = null;
        if (this._tooltipTextBlock) {
            this._tooltipTextBlock.dispose();
        }
        if (this._tooltipTexture) {
            this._tooltipTexture.dispose();
        }
        if (this._tooltipMesh) {
            this._tooltipMesh.dispose();
        }
        this.onPointerEnterObservable.remove(this._tooltipHoverObserver);
        this.onPointerOutObservable.remove(this._tooltipOutObserver);
    };
    Object.defineProperty(HolographicButton.prototype, "renderingGroupId", {
        get: function () {
            return this._backPlate.renderingGroupId;
        },
        /**
         * Rendering ground id of all the mesh in the button
         */
        set: function (id) {
            this._backPlate.renderingGroupId = id;
            this._textPlate.renderingGroupId = id;
            this._frontPlate.renderingGroupId = id;
            if (this._tooltipMesh) {
                this._tooltipMesh.renderingGroupId = id;
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(HolographicButton.prototype, "tooltipText", {
        get: function () {
            if (this._tooltipTextBlock) {
                return this._tooltipTextBlock.text;
            }
            return null;
        },
        /**
         * Text to be displayed on the tooltip shown when hovering on the button. When set to null tooltip is disabled. (Default: null)
         */
        set: function (text) {
            var _this = this;
            if (!text) {
                this._disposeTooltip();
                return;
            }
            if (!this._tooltipFade) {
                var rightHandedScene = this._backPlate._scene.useRightHandedSystem;
                // Create tooltip with mesh and text
                this._tooltipMesh = (0,core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.CreatePlane)("", { size: 1 }, this._backPlate._scene);
                var tooltipBackground = (0,core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.CreatePlane)("", { size: 1, sideOrientation: core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Mesh.DOUBLESIDE }, this._backPlate._scene);
                var mat = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.StandardMaterial("", this._backPlate._scene);
                mat.diffuseColor = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Color3.FromHexString("#212121");
                tooltipBackground.material = mat;
                tooltipBackground.isPickable = false;
                this._tooltipMesh.addChild(tooltipBackground);
                tooltipBackground.position = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Vector3.Forward(rightHandedScene).scale(0.05);
                this._tooltipMesh.scaling.y = 1 / 3;
                this._tooltipMesh.position = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Vector3.Up().scale(0.7).add(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Vector3.Forward(rightHandedScene).scale(-0.15));
                this._tooltipMesh.isPickable = false;
                this._tooltipMesh.parent = this._backPlate;
                // Create text texture for the tooltip
                this._tooltipTexture = _2D_advancedDynamicTexture__WEBPACK_IMPORTED_MODULE_7__.AdvancedDynamicTexture.CreateForMesh(this._tooltipMesh);
                this._tooltipTextBlock = new _2D_controls_textBlock__WEBPACK_IMPORTED_MODULE_6__.TextBlock();
                this._tooltipTextBlock.scaleY = 3;
                this._tooltipTextBlock.color = "white";
                this._tooltipTextBlock.fontSize = 130;
                this._tooltipTexture.addControl(this._tooltipTextBlock);
                // Add hover action to tooltip
                this._tooltipFade = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.FadeInOutBehavior();
                this._tooltipFade.delay = 500;
                this._tooltipMesh.addBehavior(this._tooltipFade);
                this._tooltipHoverObserver = this.onPointerEnterObservable.add(function () {
                    if (_this._tooltipFade) {
                        _this._tooltipFade.fadeIn(true);
                    }
                });
                this._tooltipOutObserver = this.onPointerOutObservable.add(function () {
                    if (_this._tooltipFade) {
                        _this._tooltipFade.fadeIn(false);
                    }
                });
            }
            if (this._tooltipTextBlock) {
                this._tooltipTextBlock.text = text;
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(HolographicButton.prototype, "text", {
        /**
         * Gets or sets text for the button
         */
        get: function () {
            return this._text;
        },
        set: function (value) {
            if (this._text === value) {
                return;
            }
            this._text = value;
            this._rebuildContent();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(HolographicButton.prototype, "imageUrl", {
        /**
         * Gets or sets the image url for the button
         */
        get: function () {
            return this._imageUrl;
        },
        set: function (value) {
            if (this._imageUrl === value) {
                return;
            }
            this._imageUrl = value;
            this._rebuildContent();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(HolographicButton.prototype, "backMaterial", {
        /**
         * Gets the back material used by this button
         */
        get: function () {
            return this._backMaterial;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(HolographicButton.prototype, "frontMaterial", {
        /**
         * Gets the front material used by this button
         */
        get: function () {
            return this._frontMaterial;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(HolographicButton.prototype, "plateMaterial", {
        /**
         * Gets the plate material used by this button
         */
        get: function () {
            return this._plateMaterial;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(HolographicButton.prototype, "shareMaterials", {
        /**
         * Gets a boolean indicating if this button shares its material with other HolographicButtons
         */
        get: function () {
            return this._shareMaterials;
        },
        enumerable: false,
        configurable: true
    });
    HolographicButton.prototype._getTypeName = function () {
        return "HolographicButton";
    };
    HolographicButton.prototype._rebuildContent = function () {
        this._disposeFacadeTexture();
        var panel = new _2D_controls_stackPanel__WEBPACK_IMPORTED_MODULE_4__.StackPanel();
        panel.isVertical = true;
        if (core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.DomManagement.IsDocumentAvailable() && !!document.createElement) {
            if (this._imageUrl) {
                var image = new _2D_controls_image__WEBPACK_IMPORTED_MODULE_5__.Image();
                image.source = this._imageUrl;
                image.paddingTop = "40px";
                image.height = "180px";
                image.width = "100px";
                image.paddingBottom = "40px";
                panel.addControl(image);
            }
        }
        if (this._text) {
            var text = new _2D_controls_textBlock__WEBPACK_IMPORTED_MODULE_6__.TextBlock();
            text.text = this._text;
            text.color = "white";
            text.height = "30px";
            text.fontSize = 24;
            panel.addControl(text);
        }
        if (this._frontPlate) {
            this.content = panel;
        }
    };
    // Mesh association
    HolographicButton.prototype._createNode = function (scene) {
        this._backPlate = (0,core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.CreateBox)(this.name + "BackMesh", {
            width: 1.0,
            height: 1.0,
            depth: 0.08,
        }, scene);
        this._frontPlate = (0,core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.CreateBox)(this.name + "FrontMesh", {
            width: 1.0,
            height: 1.0,
            depth: 0.08,
        }, scene);
        this._frontPlate.parent = this._backPlate;
        this._frontPlate.position = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Vector3.Forward(scene.useRightHandedSystem).scale(-0.08);
        this._frontPlate.isPickable = false;
        this._frontPlate.setEnabled(false);
        this._textPlate = _super.prototype._createNode.call(this, scene);
        this._textPlate.parent = this._backPlate;
        this._textPlate.position = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Vector3.Forward(scene.useRightHandedSystem).scale(-0.08);
        this._textPlate.isPickable = false;
        return this._backPlate;
    };
    HolographicButton.prototype._applyFacade = function (facadeTexture) {
        this._plateMaterial.emissiveTexture = facadeTexture;
        this._plateMaterial.opacityTexture = facadeTexture;
    };
    HolographicButton.prototype._createBackMaterial = function (mesh) {
        var _this = this;
        this._backMaterial = new _materials_fluent_fluentMaterial__WEBPACK_IMPORTED_MODULE_3__.FluentMaterial(this.name + "Back Material", mesh.getScene());
        this._backMaterial.renderHoverLight = true;
        this._pickedPointObserver = this._host.onPickedPointChangedObservable.add(function (pickedPoint) {
            if (pickedPoint) {
                _this._backMaterial.hoverPosition = pickedPoint;
                _this._backMaterial.hoverColor.a = 1.0;
            }
            else {
                _this._backMaterial.hoverColor.a = 0;
            }
        });
    };
    HolographicButton.prototype._createFrontMaterial = function (mesh) {
        this._frontMaterial = new _materials_fluent_fluentMaterial__WEBPACK_IMPORTED_MODULE_3__.FluentMaterial(this.name + "Front Material", mesh.getScene());
        this._frontMaterial.innerGlowColorIntensity = 0; // No inner glow
        this._frontMaterial.alpha = 0.5; // Additive
        this._frontMaterial.renderBorders = true;
    };
    HolographicButton.prototype._createPlateMaterial = function (mesh) {
        this._plateMaterial = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.StandardMaterial(this.name + "Plate Material", mesh.getScene());
        this._plateMaterial.specularColor = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__.Color3.Black();
    };
    HolographicButton.prototype._affectMaterial = function (mesh) {
        // Back
        if (this._shareMaterials) {
            if (!this._host._sharedMaterials["backFluentMaterial"]) {
                this._createBackMaterial(mesh);
                this._host._sharedMaterials["backFluentMaterial"] = this._backMaterial;
            }
            else {
                this._backMaterial = this._host._sharedMaterials["backFluentMaterial"];
            }
            // Front
            if (!this._host._sharedMaterials["frontFluentMaterial"]) {
                this._createFrontMaterial(mesh);
                this._host._sharedMaterials["frontFluentMaterial"] = this._frontMaterial;
            }
            else {
                this._frontMaterial = this._host._sharedMaterials["frontFluentMaterial"];
            }
        }
        else {
            this._createBackMaterial(mesh);
            this._createFrontMaterial(mesh);
        }
        this._createPlateMaterial(mesh);
        this._backPlate.material = this._backMaterial;
        this._frontPlate.material = this._frontMaterial;
        this._textPlate.material = this._plateMaterial;
        this._rebuildContent();
    };
    /**
     * Releases all associated resources
     */
    HolographicButton.prototype.dispose = function () {
        _super.prototype.dispose.call(this); // will dispose main mesh ie. back plate
        this._disposeTooltip();
        if (!this.shareMaterials) {
            this._backMaterial.dispose();
            this._frontMaterial.dispose();
            this._plateMaterial.dispose();
            if (this._pickedPointObserver) {
                this._host.onPickedPointChangedObservable.remove(this._pickedPointObserver);
                this._pickedPointObserver = null;
            }
        }
    };
    return HolographicButton;
}(_button3D__WEBPACK_IMPORTED_MODULE_1__.Button3D));



/***/ }),

/***/ "../../../lts/gui/dist/3D/controls/holographicSlate.js":
/*!*************************************************************!*\
  !*** ../../../lts/gui/dist/3D/controls/holographicSlate.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "HolographicSlate": () => (/* binding */ HolographicSlate)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var _contentDisplay3D__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./contentDisplay3D */ "../../../lts/gui/dist/3D/controls/contentDisplay3D.js");
/* harmony import */ var _touchHolographicButton__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./touchHolographicButton */ "../../../lts/gui/dist/3D/controls/touchHolographicButton.js");
/* harmony import */ var _2D_advancedDynamicTexture__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../2D/advancedDynamicTexture */ "../../../lts/gui/dist/2D/advancedDynamicTexture.js");
/* harmony import */ var _2D_controls_control__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../2D/controls/control */ "../../../lts/gui/dist/2D/controls/control.js");
/* harmony import */ var _2D_controls_textBlock__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../2D/controls/textBlock */ "../../../lts/gui/dist/2D/controls/textBlock.js");
/* harmony import */ var _behaviors_defaultBehavior__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../behaviors/defaultBehavior */ "../../../lts/gui/dist/3D/behaviors/defaultBehavior.js");
/* harmony import */ var _gizmos_slateGizmo__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../gizmos/slateGizmo */ "../../../lts/gui/dist/3D/gizmos/slateGizmo.js");
/* harmony import */ var _materials_fluent_fluentMaterial__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../materials/fluent/fluentMaterial */ "../../../lts/gui/dist/3D/materials/fluent/fluentMaterial.js");
/* harmony import */ var _materials_fluentBackplate_fluentBackplateMaterial__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../materials/fluentBackplate/fluentBackplateMaterial */ "../../../lts/gui/dist/3D/materials/fluentBackplate/fluentBackplateMaterial.js");
/* harmony import */ var core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core/Meshes/mesh.vertexData */ "core/Misc/observable");
/* harmony import */ var core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__);




















/**
 * Class used to create a holographic slate
 * @since 5.0.0
 */
var HolographicSlate = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(HolographicSlate, _super);
    /**
     * Creates a new slate
     * @param name defines the control name
     */
    function HolographicSlate(name) {
        var _this = _super.call(this, name) || this;
        /**
         * Margin between title bar and contentplate
         */
        _this.titleBarMargin = 0.005;
        /**
         * Origin in local coordinates (top left corner)
         */
        _this.origin = new core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Vector3(0, 0, 0);
        _this._dimensions = new core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Vector2(21.875, 12.5);
        _this._titleBarHeight = 0.625;
        _this._titleText = "";
        _this._contentScaleRatio = 1;
        /**
         * Minimum dimensions of the slate
         */
        _this.minDimensions = new core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Vector2(15.625, 6.25);
        /**
         * Default dimensions of the slate
         */
        _this.defaultDimensions = _this._dimensions.clone();
        _this._followButton = new _touchHolographicButton__WEBPACK_IMPORTED_MODULE_2__.TouchHolographicButton("followButton" + _this.name);
        _this._followButton.isToggleButton = true;
        _this._closeButton = new _touchHolographicButton__WEBPACK_IMPORTED_MODULE_2__.TouchHolographicButton("closeButton" + _this.name);
        _this._contentViewport = new core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Viewport(0, 0, 1, 1);
        _this._contentDragBehavior = new core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.PointerDragBehavior({
            dragPlaneNormal: new core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Vector3(0, 0, -1),
        });
        return _this;
    }
    Object.defineProperty(HolographicSlate.prototype, "defaultBehavior", {
        /**
         * Regroups all mesh behaviors for the slate
         */
        get: function () {
            return this._defaultBehavior;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(HolographicSlate.prototype, "dimensions", {
        /**
         * 2D dimensions of the slate
         */
        get: function () {
            return this._dimensions;
        },
        set: function (value) {
            //clamp, respecting ratios
            var scale = 1.0;
            if (value.x < this.minDimensions.x || value.y < this.minDimensions.y) {
                var newRatio = value.x / value.y;
                var minRatio = this.minDimensions.x / this.minDimensions.y;
                if (minRatio > newRatio) {
                    // We just need to make sure the x-val is greater than the min
                    scale = this.minDimensions.x / value.x;
                }
                else {
                    // We just need to make sure the y-val is greater than the min
                    scale = this.minDimensions.y / value.y;
                }
            }
            this._dimensions.copyFrom(value).scaleInPlace(scale);
            this._updatePivot();
            this._positionElements();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(HolographicSlate.prototype, "titleBarHeight", {
        /**
         * Height of the title bar component
         */
        get: function () {
            return this._titleBarHeight;
        },
        set: function (value) {
            this._titleBarHeight = value;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(HolographicSlate.prototype, "renderingGroupId", {
        get: function () {
            return this._titleBar.renderingGroupId;
        },
        /**
         * Rendering ground id of all the meshes
         */
        set: function (id) {
            this._titleBar.renderingGroupId = id;
            this._titleBarTitle.renderingGroupId = id;
            this._contentPlate.renderingGroupId = id;
            this._backPlate.renderingGroupId = id;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(HolographicSlate.prototype, "title", {
        get: function () {
            return this._titleText;
        },
        /**
         * The title text displayed at the top of the slate
         */
        set: function (title) {
            this._titleText = title;
            if (this._titleTextComponent) {
                this._titleTextComponent.text = title;
            }
        },
        enumerable: false,
        configurable: true
    });
    /**
     * Apply the facade texture (created from the content property).
     * This function can be overloaded by child classes
     * @param facadeTexture defines the AdvancedDynamicTexture to use
     */
    HolographicSlate.prototype._applyFacade = function (facadeTexture) {
        this._contentMaterial.albedoTexture = facadeTexture;
        this._resetContentPositionAndZoom();
        this._applyContentViewport();
        facadeTexture.attachToMesh(this._contentPlate, true);
    };
    HolographicSlate.prototype._addControl = function (control) {
        control._host = this._host;
        if (this._host.utilityLayer) {
            control._prepareNode(this._host.utilityLayer.utilityLayerScene);
        }
    };
    HolographicSlate.prototype._getTypeName = function () {
        return "HolographicSlate";
    };
    /**
     * @hidden
     */
    HolographicSlate.prototype._positionElements = function () {
        var followButton = this._followButton;
        var closeButton = this._closeButton;
        var titleBar = this._titleBar;
        var titleBarTitle = this._titleBarTitle;
        var contentPlate = this._contentPlate;
        var backPlate = this._backPlate;
        if (followButton && closeButton && titleBar) {
            closeButton.scaling.setAll(this.titleBarHeight);
            followButton.scaling.setAll(this.titleBarHeight);
            closeButton.position.copyFromFloats(this.dimensions.x - this.titleBarHeight / 2, -this.titleBarHeight / 2, 0).addInPlace(this.origin);
            followButton.position.copyFromFloats(this.dimensions.x - (3 * this.titleBarHeight) / 2, -this.titleBarHeight / 2, 0).addInPlace(this.origin);
            var contentPlateHeight = this.dimensions.y - this.titleBarHeight - this.titleBarMargin;
            var rightHandScene = contentPlate.getScene().useRightHandedSystem;
            titleBar.scaling.set(this.dimensions.x, this.titleBarHeight, core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Epsilon);
            titleBarTitle.scaling.set(this.dimensions.x - 2 * this.titleBarHeight, this.titleBarHeight, core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Epsilon);
            contentPlate.scaling.copyFromFloats(this.dimensions.x, contentPlateHeight, core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Epsilon);
            backPlate.scaling.copyFromFloats(this.dimensions.x, contentPlateHeight, core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Epsilon);
            titleBar.position.copyFromFloats(this.dimensions.x / 2, -(this.titleBarHeight / 2), 0).addInPlace(this.origin);
            titleBarTitle.position
                .copyFromFloats(this.dimensions.x / 2 - this.titleBarHeight, -(this.titleBarHeight / 2), rightHandScene ? core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Epsilon : -core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Epsilon)
                .addInPlace(this.origin);
            contentPlate.position.copyFromFloats(this.dimensions.x / 2, -(this.titleBarHeight + this.titleBarMargin + contentPlateHeight / 2), 0).addInPlace(this.origin);
            backPlate.position
                .copyFromFloats(this.dimensions.x / 2, -(this.titleBarHeight + this.titleBarMargin + contentPlateHeight / 2), rightHandScene ? -core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Epsilon : core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Epsilon)
                .addInPlace(this.origin);
            // Update the title's AdvancedDynamicTexture scale to avoid visual stretching
            this._titleTextComponent.host.scaleTo((HolographicSlate._DEFAULT_TEXT_RESOLUTION_Y * titleBarTitle.scaling.x) / titleBarTitle.scaling.y, HolographicSlate._DEFAULT_TEXT_RESOLUTION_Y);
            var aspectRatio = this.dimensions.x / contentPlateHeight;
            this._contentViewport.width = this._contentScaleRatio;
            this._contentViewport.height = this._contentScaleRatio / aspectRatio;
            this._applyContentViewport();
            if (this._gizmo) {
                this._gizmo.updateBoundingBox();
            }
        }
    };
    HolographicSlate.prototype._applyContentViewport = function () {
        var _a;
        if (((_a = this._contentPlate) === null || _a === void 0 ? void 0 : _a.material) && this._contentPlate.material.albedoTexture) {
            var tex = this._contentPlate.material.albedoTexture;
            tex.uScale = this._contentScaleRatio;
            tex.vScale = (this._contentScaleRatio / this._contentViewport.width) * this._contentViewport.height;
            tex.uOffset = this._contentViewport.x;
            tex.vOffset = this._contentViewport.y;
        }
    };
    HolographicSlate.prototype._resetContentPositionAndZoom = function () {
        this._contentViewport.x = 0;
        this._contentViewport.y = 1 - this._contentViewport.height / this._contentViewport.width;
        this._contentScaleRatio = 1;
    };
    /**
     * @hidden
     */
    HolographicSlate.prototype._updatePivot = function () {
        if (!this.mesh) {
            return;
        }
        // Update pivot point so it is at the center of geometry
        // As origin is topleft corner in 2D, dimensions are calculated towards bottom right corner, thus y axis is downwards
        var center = new core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Vector3(this.dimensions.x * 0.5, -this.dimensions.y * 0.5, core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Epsilon);
        center.addInPlace(this.origin);
        center.z = 0;
        var origin = new core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Vector3(0, 0, 0);
        core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Vector3.TransformCoordinatesToRef(origin, this.mesh.computeWorldMatrix(true), origin);
        this.mesh.setPivotPoint(center);
        var origin2 = new core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Vector3(0, 0, 0);
        core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Vector3.TransformCoordinatesToRef(origin2, this.mesh.computeWorldMatrix(true), origin2);
        this.mesh.position.addInPlace(origin).subtractInPlace(origin2);
    };
    // Mesh association
    HolographicSlate.prototype._createNode = function (scene) {
        var _this = this;
        var node = new core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Mesh("slate_" + this.name, scene);
        this._titleBar = (0,core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.CreateBox)("titleBar_" + this.name, { size: 1 }, scene);
        this._titleBarTitle = (0,core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.CreatePlane)("titleText_" + this.name, { size: 1 }, scene);
        this._titleBarTitle.parent = node;
        this._titleBarTitle.isPickable = false;
        var adt = _2D_advancedDynamicTexture__WEBPACK_IMPORTED_MODULE_3__.AdvancedDynamicTexture.CreateForMesh(this._titleBarTitle);
        this._titleTextComponent = new _2D_controls_textBlock__WEBPACK_IMPORTED_MODULE_5__.TextBlock("titleText_" + this.name, this._titleText);
        this._titleTextComponent.textWrapping = _2D_controls_textBlock__WEBPACK_IMPORTED_MODULE_5__.TextWrapping.Ellipsis;
        this._titleTextComponent.textHorizontalAlignment = _2D_controls_control__WEBPACK_IMPORTED_MODULE_4__.Control.HORIZONTAL_ALIGNMENT_LEFT;
        this._titleTextComponent.color = "white";
        this._titleTextComponent.fontSize = HolographicSlate._DEFAULT_TEXT_RESOLUTION_Y / 2;
        this._titleTextComponent.paddingLeft = HolographicSlate._DEFAULT_TEXT_RESOLUTION_Y / 4;
        adt.addControl(this._titleTextComponent);
        if (scene.useRightHandedSystem) {
            var faceUV = new core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Vector4(0, 0, 1, 1);
            this._contentPlate = (0,core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.CreatePlane)("contentPlate_" + this.name, { size: 1, sideOrientation: core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.VertexData.BACKSIDE, frontUVs: faceUV }, scene);
            this._backPlate = (0,core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.CreatePlane)("backPlate_" + this.name, { size: 1, sideOrientation: core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.VertexData.FRONTSIDE }, scene);
        }
        else {
            var faceUV = new core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Vector4(0, 0, 1, 1);
            this._contentPlate = (0,core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.CreatePlane)("contentPlate_" + this.name, { size: 1, sideOrientation: core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.VertexData.FRONTSIDE, frontUVs: faceUV }, scene);
            this._backPlate = (0,core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.CreatePlane)("backPlate_" + this.name, { size: 1, sideOrientation: core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.VertexData.BACKSIDE }, scene);
        }
        this._titleBar.parent = node;
        this._titleBar.isNearGrabbable = true;
        this._contentPlate.parent = node;
        this._backPlate.parent = node;
        this._attachContentPlateBehavior();
        this._addControl(this._followButton);
        this._addControl(this._closeButton);
        var followButton = this._followButton;
        var closeButton = this._closeButton;
        followButton.node.parent = node;
        closeButton.node.parent = node;
        this._positionElements();
        this._followButton.imageUrl = HolographicSlate.ASSETS_BASE_URL + HolographicSlate.FOLLOW_ICON_FILENAME;
        this._closeButton.imageUrl = HolographicSlate.ASSETS_BASE_URL + HolographicSlate.CLOSE_ICON_FILENAME;
        this._followButton.isBackplateVisible = false;
        this._closeButton.isBackplateVisible = false;
        this._followButton.onToggleObservable.add(function (isToggled) {
            _this._defaultBehavior.followBehaviorEnabled = isToggled;
            if (_this._defaultBehavior.followBehaviorEnabled) {
                _this._defaultBehavior.followBehavior.recenter();
            }
        });
        this._closeButton.onPointerClickObservable.add(function () {
            _this.dispose();
        });
        node.rotationQuaternion = core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Quaternion.Identity();
        node.isVisible = false;
        return node;
    };
    HolographicSlate.prototype._attachContentPlateBehavior = function () {
        var _this = this;
        this._contentDragBehavior.attach(this._contentPlate);
        this._contentDragBehavior.moveAttached = false;
        this._contentDragBehavior.useObjectOrientationForDragging = true;
        this._contentDragBehavior.updateDragPlane = false;
        var origin = new core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Vector3();
        var worldDimensions = new core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Vector3();
        var upWorld = new core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Vector3();
        var rightWorld = new core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Vector3();
        var projectedOffset = new core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Vector2();
        var startViewport;
        var worldMatrix;
        this._contentDragBehavior.onDragStartObservable.add(function (event) {
            if (!_this.node) {
                return;
            }
            startViewport = _this._contentViewport.clone();
            worldMatrix = _this.node.computeWorldMatrix(true);
            origin.copyFrom(event.dragPlanePoint);
            worldDimensions.set(_this.dimensions.x, _this.dimensions.y, core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Epsilon);
            worldDimensions.y -= _this.titleBarHeight + _this.titleBarMargin;
            core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Vector3.TransformNormalToRef(worldDimensions, worldMatrix, worldDimensions);
            upWorld.copyFromFloats(0, 1, 0);
            core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Vector3.TransformNormalToRef(upWorld, worldMatrix, upWorld);
            rightWorld.copyFromFloats(1, 0, 0);
            core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Vector3.TransformNormalToRef(rightWorld, worldMatrix, rightWorld);
            upWorld.normalize();
            upWorld.scaleInPlace(1 / core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Vector3.Dot(upWorld, worldDimensions));
            rightWorld.normalize();
            rightWorld.scaleInPlace(1 / core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Vector3.Dot(rightWorld, worldDimensions));
        });
        var offset = new core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Vector3();
        this._contentDragBehavior.onDragObservable.add(function (event) {
            offset.copyFrom(event.dragPlanePoint);
            offset.subtractInPlace(origin);
            projectedOffset.copyFromFloats(core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Vector3.Dot(offset, rightWorld), core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Vector3.Dot(offset, upWorld));
            // By default, content takes full width available and height is cropped to keep aspect ratio
            _this._contentViewport.x = core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Scalar.Clamp(startViewport.x - offset.x, 0, 1 - _this._contentViewport.width * _this._contentScaleRatio);
            _this._contentViewport.y = core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Scalar.Clamp(startViewport.y - offset.y, 0, 1 - _this._contentViewport.height * _this._contentScaleRatio);
            _this._applyContentViewport();
        });
    };
    HolographicSlate.prototype._affectMaterial = function (mesh) {
        // TODO share materials
        this._titleBarMaterial = new _materials_fluentBackplate_fluentBackplateMaterial__WEBPACK_IMPORTED_MODULE_9__.FluentBackplateMaterial("".concat(this.name, " plateMaterial"), mesh.getScene());
        this._contentMaterial = new _materials_fluent_fluentMaterial__WEBPACK_IMPORTED_MODULE_8__.FluentMaterial("".concat(this.name, " contentMaterial"), mesh.getScene());
        this._contentMaterial.renderBorders = true;
        this._backMaterial = new _materials_fluentBackplate_fluentBackplateMaterial__WEBPACK_IMPORTED_MODULE_9__.FluentBackplateMaterial("".concat(this.name, " backPlate"), mesh.getScene());
        this._backMaterial.lineWidth = core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Epsilon;
        this._backMaterial.radius = 0.005;
        this._backMaterial.backFaceCulling = true;
        this._titleBar.material = this._titleBarMaterial;
        this._contentPlate.material = this._contentMaterial;
        this._backPlate.material = this._backMaterial;
        this._resetContent();
        this._applyContentViewport();
    };
    /**
     * @param scene
     * @hidden*
     */
    HolographicSlate.prototype._prepareNode = function (scene) {
        var _this = this;
        _super.prototype._prepareNode.call(this, scene);
        this._gizmo = new _gizmos_slateGizmo__WEBPACK_IMPORTED_MODULE_7__.SlateGizmo(this._host.utilityLayer);
        this._gizmo.attachedSlate = this;
        this._defaultBehavior = new _behaviors_defaultBehavior__WEBPACK_IMPORTED_MODULE_6__.DefaultBehavior();
        this._defaultBehavior.attach(this.node, [this._titleBar]);
        this._defaultBehavior.sixDofDragBehavior.onDragStartObservable.add(function () {
            _this._followButton.isToggled = false;
        });
        this._positionChangedObserver = this._defaultBehavior.sixDofDragBehavior.onPositionChangedObservable.add(function () {
            _this._gizmo.updateBoundingBox();
        });
        this._updatePivot();
        this.resetDefaultAspectAndPose(false);
    };
    /**
     * Resets the aspect and pose of the slate so it is right in front of the active camera, facing towards it.
     * @param resetAspect Should the slate's dimensions/aspect ratio be reset as well
     */
    HolographicSlate.prototype.resetDefaultAspectAndPose = function (resetAspect) {
        if (resetAspect === void 0) { resetAspect = true; }
        if (!this._host || !this._host.utilityLayer || !this.node) {
            return;
        }
        var scene = this._host.utilityLayer.utilityLayerScene;
        var camera = scene.activeCamera;
        if (camera) {
            var worldMatrix = camera.getWorldMatrix();
            var backward = core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Vector3.TransformNormal(core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Vector3.Backward(scene.useRightHandedSystem), worldMatrix);
            this.origin.setAll(0);
            this._gizmo.updateBoundingBox();
            var pivot = this.node.getAbsolutePivotPoint();
            this.node.position.copyFrom(camera.position).subtractInPlace(backward).subtractInPlace(pivot);
            this.node.rotationQuaternion = core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Quaternion.FromLookDirectionLH(backward, new core_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__.Vector3(0, 1, 0));
            if (resetAspect) {
                this.dimensions = this.defaultDimensions;
            }
        }
    };
    /**
     * Releases all associated resources
     */
    HolographicSlate.prototype.dispose = function () {
        _super.prototype.dispose.call(this);
        this._titleBarMaterial.dispose();
        this._contentMaterial.dispose();
        this._titleBar.dispose();
        this._titleBarTitle.dispose();
        this._contentPlate.dispose();
        this._backPlate.dispose();
        this._followButton.dispose();
        this._closeButton.dispose();
        this._host.onPickedPointChangedObservable.remove(this._pickedPointObserver);
        this._defaultBehavior.sixDofDragBehavior.onPositionChangedObservable.remove(this._positionChangedObserver);
        this._defaultBehavior.detach();
        this._gizmo.dispose();
        this._contentDragBehavior.detach();
    };
    /**
     * Base Url for the assets.
     */
    HolographicSlate.ASSETS_BASE_URL = "https://assets.babylonjs.com/meshes/MRTK/";
    /**
     * File name for the close icon.
     */
    HolographicSlate.CLOSE_ICON_FILENAME = "IconClose.png";
    /**
     * File name for the close icon.
     */
    HolographicSlate.FOLLOW_ICON_FILENAME = "IconFollowMe.png";
    HolographicSlate._DEFAULT_TEXT_RESOLUTION_Y = 102.4;
    return HolographicSlate;
}(_contentDisplay3D__WEBPACK_IMPORTED_MODULE_1__.ContentDisplay3D));



/***/ }),

/***/ "../../../lts/gui/dist/3D/controls/index.js":
/*!**************************************************!*\
  !*** ../../../lts/gui/dist/3D/controls/index.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "AbstractButton3D": () => (/* reexport safe */ _abstractButton3D__WEBPACK_IMPORTED_MODULE_0__.AbstractButton3D),
/* harmony export */   "Button3D": () => (/* reexport safe */ _button3D__WEBPACK_IMPORTED_MODULE_1__.Button3D),
/* harmony export */   "Container3D": () => (/* reexport safe */ _container3D__WEBPACK_IMPORTED_MODULE_2__.Container3D),
/* harmony export */   "Control3D": () => (/* reexport safe */ _control3D__WEBPACK_IMPORTED_MODULE_3__.Control3D),
/* harmony export */   "CylinderPanel": () => (/* reexport safe */ _cylinderPanel__WEBPACK_IMPORTED_MODULE_4__.CylinderPanel),
/* harmony export */   "HandMenu": () => (/* reexport safe */ _handMenu__WEBPACK_IMPORTED_MODULE_7__.HandMenu),
/* harmony export */   "HolographicBackplate": () => (/* reexport safe */ _holographicBackplate__WEBPACK_IMPORTED_MODULE_20__.HolographicBackplate),
/* harmony export */   "HolographicButton": () => (/* reexport safe */ _holographicButton__WEBPACK_IMPORTED_MODULE_5__.HolographicButton),
/* harmony export */   "HolographicSlate": () => (/* reexport safe */ _holographicSlate__WEBPACK_IMPORTED_MODULE_6__.HolographicSlate),
/* harmony export */   "MeshButton3D": () => (/* reexport safe */ _meshButton3D__WEBPACK_IMPORTED_MODULE_8__.MeshButton3D),
/* harmony export */   "NearMenu": () => (/* reexport safe */ _nearMenu__WEBPACK_IMPORTED_MODULE_9__.NearMenu),
/* harmony export */   "PlanePanel": () => (/* reexport safe */ _planePanel__WEBPACK_IMPORTED_MODULE_10__.PlanePanel),
/* harmony export */   "ScatterPanel": () => (/* reexport safe */ _scatterPanel__WEBPACK_IMPORTED_MODULE_11__.ScatterPanel),
/* harmony export */   "Slider3D": () => (/* reexport safe */ _slider3D__WEBPACK_IMPORTED_MODULE_12__.Slider3D),
/* harmony export */   "SpherePanel": () => (/* reexport safe */ _spherePanel__WEBPACK_IMPORTED_MODULE_13__.SpherePanel),
/* harmony export */   "StackPanel3D": () => (/* reexport safe */ _stackPanel3D__WEBPACK_IMPORTED_MODULE_14__.StackPanel3D),
/* harmony export */   "TouchButton3D": () => (/* reexport safe */ _touchButton3D__WEBPACK_IMPORTED_MODULE_15__.TouchButton3D),
/* harmony export */   "TouchHolographicButton": () => (/* reexport safe */ _touchHolographicButton__WEBPACK_IMPORTED_MODULE_17__.TouchHolographicButton),
/* harmony export */   "TouchHolographicMenu": () => (/* reexport safe */ _touchHolographicMenu__WEBPACK_IMPORTED_MODULE_18__.TouchHolographicMenu),
/* harmony export */   "TouchMeshButton3D": () => (/* reexport safe */ _touchMeshButton3D__WEBPACK_IMPORTED_MODULE_16__.TouchMeshButton3D),
/* harmony export */   "VolumeBasedPanel": () => (/* reexport safe */ _volumeBasedPanel__WEBPACK_IMPORTED_MODULE_19__.VolumeBasedPanel)
/* harmony export */ });
/* harmony import */ var _abstractButton3D__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./abstractButton3D */ "../../../lts/gui/dist/3D/controls/abstractButton3D.js");
/* harmony import */ var _button3D__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./button3D */ "../../../lts/gui/dist/3D/controls/button3D.js");
/* harmony import */ var _container3D__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./container3D */ "../../../lts/gui/dist/3D/controls/container3D.js");
/* harmony import */ var _control3D__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./control3D */ "../../../lts/gui/dist/3D/controls/control3D.js");
/* harmony import */ var _cylinderPanel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./cylinderPanel */ "../../../lts/gui/dist/3D/controls/cylinderPanel.js");
/* harmony import */ var _holographicButton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./holographicButton */ "../../../lts/gui/dist/3D/controls/holographicButton.js");
/* harmony import */ var _holographicSlate__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./holographicSlate */ "../../../lts/gui/dist/3D/controls/holographicSlate.js");
/* harmony import */ var _handMenu__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./handMenu */ "../../../lts/gui/dist/3D/controls/handMenu.js");
/* harmony import */ var _meshButton3D__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./meshButton3D */ "../../../lts/gui/dist/3D/controls/meshButton3D.js");
/* harmony import */ var _nearMenu__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./nearMenu */ "../../../lts/gui/dist/3D/controls/nearMenu.js");
/* harmony import */ var _planePanel__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./planePanel */ "../../../lts/gui/dist/3D/controls/planePanel.js");
/* harmony import */ var _scatterPanel__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./scatterPanel */ "../../../lts/gui/dist/3D/controls/scatterPanel.js");
/* harmony import */ var _slider3D__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./slider3D */ "../../../lts/gui/dist/3D/controls/slider3D.js");
/* harmony import */ var _spherePanel__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./spherePanel */ "../../../lts/gui/dist/3D/controls/spherePanel.js");
/* harmony import */ var _stackPanel3D__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./stackPanel3D */ "../../../lts/gui/dist/3D/controls/stackPanel3D.js");
/* harmony import */ var _touchButton3D__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./touchButton3D */ "../../../lts/gui/dist/3D/controls/touchButton3D.js");
/* harmony import */ var _touchMeshButton3D__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./touchMeshButton3D */ "../../../lts/gui/dist/3D/controls/touchMeshButton3D.js");
/* harmony import */ var _touchHolographicButton__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./touchHolographicButton */ "../../../lts/gui/dist/3D/controls/touchHolographicButton.js");
/* harmony import */ var _touchHolographicMenu__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./touchHolographicMenu */ "../../../lts/gui/dist/3D/controls/touchHolographicMenu.js");
/* harmony import */ var _volumeBasedPanel__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./volumeBasedPanel */ "../../../lts/gui/dist/3D/controls/volumeBasedPanel.js");
/* harmony import */ var _holographicBackplate__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./holographicBackplate */ "../../../lts/gui/dist/3D/controls/holographicBackplate.js");























/***/ }),

/***/ "../../../lts/gui/dist/3D/controls/meshButton3D.js":
/*!*********************************************************!*\
  !*** ../../../lts/gui/dist/3D/controls/meshButton3D.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "MeshButton3D": () => (/* binding */ MeshButton3D)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var _button3D__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./button3D */ "../../../lts/gui/dist/3D/controls/button3D.js");


/**
 * Class used to create an interactable object. It's a 3D button using a mesh coming from the current scene
 */
var MeshButton3D = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(MeshButton3D, _super);
    /**
     * Creates a new 3D button based on a mesh
     * @param mesh mesh to become a 3D button
     * @param name defines the control name
     */
    function MeshButton3D(mesh, name) {
        var _this = _super.call(this, name) || this;
        _this._currentMesh = mesh;
        /**
         * Provides a default behavior on hover/out & up/down
         * Override those function to create your own desired behavior specific to your mesh
         */
        _this.pointerEnterAnimation = function () {
            if (!_this.mesh) {
                return;
            }
            _this.mesh.scaling.scaleInPlace(1.1);
        };
        _this.pointerOutAnimation = function () {
            if (!_this.mesh) {
                return;
            }
            _this.mesh.scaling.scaleInPlace(1.0 / 1.1);
        };
        _this.pointerDownAnimation = function () {
            if (!_this.mesh) {
                return;
            }
            _this.mesh.scaling.scaleInPlace(0.95);
        };
        _this.pointerUpAnimation = function () {
            if (!_this.mesh) {
                return;
            }
            _this.mesh.scaling.scaleInPlace(1.0 / 0.95);
        };
        return _this;
    }
    MeshButton3D.prototype._getTypeName = function () {
        return "MeshButton3D";
    };
    // Mesh association
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    MeshButton3D.prototype._createNode = function (scene) {
        var _this = this;
        this._currentMesh.getChildMeshes().forEach(function (mesh) {
            _this._injectGUI3DReservedDataStore(mesh).control = _this;
        });
        return this._currentMesh;
    };
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    MeshButton3D.prototype._affectMaterial = function (mesh) { };
    return MeshButton3D;
}(_button3D__WEBPACK_IMPORTED_MODULE_1__.Button3D));



/***/ }),

/***/ "../../../lts/gui/dist/3D/controls/nearMenu.js":
/*!*****************************************************!*\
  !*** ../../../lts/gui/dist/3D/controls/nearMenu.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "NearMenu": () => (/* binding */ NearMenu)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var _touchHolographicButton__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./touchHolographicButton */ "../../../lts/gui/dist/3D/controls/touchHolographicButton.js");
/* harmony import */ var _behaviors_defaultBehavior__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../behaviors/defaultBehavior */ "../../../lts/gui/dist/3D/behaviors/defaultBehavior.js");
/* harmony import */ var _touchHolographicMenu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./touchHolographicMenu */ "../../../lts/gui/dist/3D/controls/touchHolographicMenu.js");




/**
 * NearMenu that displays buttons and follows the camera
 * @since 5.0.0
 */
var NearMenu = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(NearMenu, _super);
    /**
     * Creates a near menu GUI 3D control
     * @param name name of the near menu
     */
    function NearMenu(name) {
        var _this = _super.call(this, name) || this;
        _this._isPinned = false;
        _this._defaultBehavior = new _behaviors_defaultBehavior__WEBPACK_IMPORTED_MODULE_2__.DefaultBehavior();
        _this._dragObserver = _this._defaultBehavior.sixDofDragBehavior.onDragObservable.add(function () {
            _this.isPinned = true;
        });
        _this.backPlateMargin = 1;
        return _this;
    }
    Object.defineProperty(NearMenu.prototype, "defaultBehavior", {
        /**
         * Regroups all mesh behaviors for the near menu
         */
        get: function () {
            return this._defaultBehavior;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(NearMenu.prototype, "isPinned", {
        /**
         * Indicates if the near menu is world-pinned
         */
        get: function () {
            return this._isPinned;
        },
        set: function (value) {
            // Tell the pin button to toggle if this was called manually, for clean state control
            if (this._pinButton.isToggled !== value) {
                this._pinButton.isToggled = value;
                return;
            }
            this._isPinned = value;
            if (value) {
                this._defaultBehavior.followBehaviorEnabled = false;
            }
            else {
                this._defaultBehavior.followBehaviorEnabled = true;
            }
        },
        enumerable: false,
        configurable: true
    });
    NearMenu.prototype._createPinButton = function (parent) {
        var _this = this;
        var control = new _touchHolographicButton__WEBPACK_IMPORTED_MODULE_1__.TouchHolographicButton("pin" + this.name, false);
        control.imageUrl = NearMenu._ASSETS_BASE_URL + NearMenu._PIN_ICON_FILENAME;
        control.parent = this;
        control._host = this._host;
        control.isToggleButton = true;
        control.onToggleObservable.add(function (newState) {
            _this.isPinned = newState;
        });
        if (this._host.utilityLayer) {
            control._prepareNode(this._host.utilityLayer.utilityLayerScene);
            control.scaling.scaleInPlace(_touchHolographicMenu__WEBPACK_IMPORTED_MODULE_3__.TouchHolographicMenu.MENU_BUTTON_SCALE);
            if (control.node) {
                control.node.parent = parent;
            }
        }
        return control;
    };
    NearMenu.prototype._createNode = function (scene) {
        var node = _super.prototype._createNode.call(this, scene);
        this._pinButton = this._createPinButton(node);
        this.isPinned = false;
        this._defaultBehavior.attach(node, [this._backPlate]);
        this._defaultBehavior.followBehavior.ignoreCameraPitchAndRoll = true;
        this._defaultBehavior.followBehavior.pitchOffset = -15;
        this._defaultBehavior.followBehavior.minimumDistance = 0.3;
        this._defaultBehavior.followBehavior.defaultDistance = 0.4;
        this._defaultBehavior.followBehavior.maximumDistance = 0.6;
        this._backPlate.isNearGrabbable = true;
        node.isVisible = false;
        return node;
    };
    NearMenu.prototype._finalProcessing = function () {
        _super.prototype._finalProcessing.call(this);
        this._pinButton.position.copyFromFloats((this._backPlate.scaling.x + _touchHolographicMenu__WEBPACK_IMPORTED_MODULE_3__.TouchHolographicMenu.MENU_BUTTON_SCALE) / 2, this._backPlate.scaling.y / 2, 0);
    };
    /**
     * Disposes the near menu
     */
    NearMenu.prototype.dispose = function () {
        _super.prototype.dispose.call(this);
        this._defaultBehavior.sixDofDragBehavior.onDragObservable.remove(this._dragObserver);
        this._defaultBehavior.detach();
    };
    /**
     * Base Url for the assets.
     */
    NearMenu._ASSETS_BASE_URL = "https://assets.babylonjs.com/meshes/MRTK/";
    /**
     * File name for the close icon.
     */
    NearMenu._PIN_ICON_FILENAME = "IconPin.png";
    return NearMenu;
}(_touchHolographicMenu__WEBPACK_IMPORTED_MODULE_3__.TouchHolographicMenu));



/***/ }),

/***/ "../../../lts/gui/dist/3D/controls/planePanel.js":
/*!*******************************************************!*\
  !*** ../../../lts/gui/dist/3D/controls/planePanel.js ***!
  \*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "PlanePanel": () => (/* binding */ PlanePanel)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Maths/math.vector */ "core/Misc/observable");
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _container3D__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./container3D */ "../../../lts/gui/dist/3D/controls/container3D.js");
/* harmony import */ var _volumeBasedPanel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./volumeBasedPanel */ "../../../lts/gui/dist/3D/controls/volumeBasedPanel.js");




/**
 * Class used to create a container panel deployed on the surface of a plane
 */
var PlanePanel = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(PlanePanel, _super);
    function PlanePanel() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    PlanePanel.prototype._mapGridNode = function (control, nodePosition) {
        var mesh = control.mesh;
        if (!mesh) {
            return;
        }
        control.position = nodePosition.clone();
        var target = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.TmpVectors.Vector3[0];
        target.copyFrom(nodePosition);
        switch (this.orientation) {
            case _container3D__WEBPACK_IMPORTED_MODULE_2__.Container3D.FACEORIGIN_ORIENTATION:
            case _container3D__WEBPACK_IMPORTED_MODULE_2__.Container3D.FACEFORWARD_ORIENTATION:
                target.addInPlace(new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Vector3(0, 0, 1));
                mesh.lookAt(target);
                break;
            case _container3D__WEBPACK_IMPORTED_MODULE_2__.Container3D.FACEFORWARDREVERSED_ORIENTATION:
            case _container3D__WEBPACK_IMPORTED_MODULE_2__.Container3D.FACEORIGINREVERSED_ORIENTATION:
                target.addInPlace(new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Vector3(0, 0, -1));
                mesh.lookAt(target);
                break;
        }
    };
    return PlanePanel;
}(_volumeBasedPanel__WEBPACK_IMPORTED_MODULE_3__.VolumeBasedPanel));



/***/ }),

/***/ "../../../lts/gui/dist/3D/controls/scatterPanel.js":
/*!*********************************************************!*\
  !*** ../../../lts/gui/dist/3D/controls/scatterPanel.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "ScatterPanel": () => (/* binding */ ScatterPanel)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Maths/math.vector */ "core/Misc/observable");
/* harmony import */ var core_Misc_tools__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _volumeBasedPanel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./volumeBasedPanel */ "../../../lts/gui/dist/3D/controls/volumeBasedPanel.js");
/* harmony import */ var _container3D__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./container3D */ "../../../lts/gui/dist/3D/controls/container3D.js");





/**
 * Class used to create a container panel where items get randomized planar mapping
 */
var ScatterPanel = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(ScatterPanel, _super);
    function ScatterPanel() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this._iteration = 100.0;
        return _this;
    }
    Object.defineProperty(ScatterPanel.prototype, "iteration", {
        /**
         * Gets or sets the number of iteration to use to scatter the controls (100 by default)
         */
        get: function () {
            return this._iteration;
        },
        set: function (value) {
            var _this = this;
            if (this._iteration === value) {
                return;
            }
            this._iteration = value;
            core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.Tools.SetImmediate(function () {
                _this._arrangeChildren();
            });
        },
        enumerable: false,
        configurable: true
    });
    ScatterPanel.prototype._mapGridNode = function (control, nodePosition) {
        var mesh = control.mesh;
        var newPos = this._scatterMapping(nodePosition);
        if (!mesh) {
            return;
        }
        switch (this.orientation) {
            case _container3D__WEBPACK_IMPORTED_MODULE_3__.Container3D.FACEORIGIN_ORIENTATION:
            case _container3D__WEBPACK_IMPORTED_MODULE_3__.Container3D.FACEFORWARD_ORIENTATION:
                mesh.lookAt(new core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.Vector3(0, 0, 1));
                break;
            case _container3D__WEBPACK_IMPORTED_MODULE_3__.Container3D.FACEFORWARDREVERSED_ORIENTATION:
            case _container3D__WEBPACK_IMPORTED_MODULE_3__.Container3D.FACEORIGINREVERSED_ORIENTATION:
                mesh.lookAt(new core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.Vector3(0, 0, -1));
                break;
        }
        control.position = newPos;
    };
    ScatterPanel.prototype._scatterMapping = function (source) {
        source.x = (1.0 - Math.random() * 2.0) * this._cellWidth;
        source.y = (1.0 - Math.random() * 2.0) * this._cellHeight;
        return source;
    };
    ScatterPanel.prototype._finalProcessing = function () {
        var meshes = [];
        for (var _i = 0, _a = this._children; _i < _a.length; _i++) {
            var child = _a[_i];
            if (!child.mesh) {
                continue;
            }
            meshes.push(child.mesh);
        }
        for (var count = 0; count < this._iteration; count++) {
            meshes.sort(function (a, b) {
                var distance1 = a.position.lengthSquared();
                var distance2 = b.position.lengthSquared();
                if (distance1 < distance2) {
                    return 1;
                }
                else if (distance1 > distance2) {
                    return -1;
                }
                return 0;
            });
            var radiusPaddingSquared = Math.pow(this.margin, 2.0);
            var cellSize = Math.max(this._cellWidth, this._cellHeight);
            var difference2D = core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.TmpVectors.Vector2[0];
            var difference = core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.TmpVectors.Vector3[0];
            for (var i = 0; i < meshes.length - 1; i++) {
                for (var j = i + 1; j < meshes.length; j++) {
                    if (i != j) {
                        meshes[j].position.subtractToRef(meshes[i].position, difference);
                        // Ignore Z axis
                        difference2D.x = difference.x;
                        difference2D.y = difference.y;
                        var combinedRadius = cellSize;
                        var distance = difference2D.lengthSquared() - radiusPaddingSquared;
                        var minSeparation = Math.min(distance, radiusPaddingSquared);
                        distance -= minSeparation;
                        if (distance < Math.pow(combinedRadius, 2.0)) {
                            difference2D.normalize();
                            difference.scaleInPlace((combinedRadius - Math.sqrt(distance)) * 0.5);
                            meshes[j].position.addInPlace(difference);
                            meshes[i].position.subtractInPlace(difference);
                        }
                    }
                }
            }
        }
    };
    return ScatterPanel;
}(_volumeBasedPanel__WEBPACK_IMPORTED_MODULE_2__.VolumeBasedPanel));



/***/ }),

/***/ "../../../lts/gui/dist/3D/controls/slider3D.js":
/*!*****************************************************!*\
  !*** ../../../lts/gui/dist/3D/controls/slider3D.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Slider3D": () => (/* binding */ Slider3D)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Loading/sceneLoader */ "core/Misc/observable");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _control3D__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./control3D */ "../../../lts/gui/dist/3D/controls/control3D.js");
/* harmony import */ var _materials_mrdl_mrdlSliderBarMaterial__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../materials/mrdl/mrdlSliderBarMaterial */ "../../../lts/gui/dist/3D/materials/mrdl/mrdlSliderBarMaterial.js");
/* harmony import */ var _materials_mrdl_mrdlSliderThumbMaterial__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../materials/mrdl/mrdlSliderThumbMaterial */ "../../../lts/gui/dist/3D/materials/mrdl/mrdlSliderThumbMaterial.js");
/* harmony import */ var _materials_mrdl_mrdlBackplateMaterial__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../materials/mrdl/mrdlBackplateMaterial */ "../../../lts/gui/dist/3D/materials/mrdl/mrdlBackplateMaterial.js");










var SLIDER_MIN = 0;
var SLIDER_MAX = 100;
var SLIDER_VAL = 50;
var SLIDER_STEP = 0;
var SLIDER_SCALING = 1.0;
var SLIDER_MARGIN = 0.2;
/**
 * Class used to create a slider in 3D
 */
var Slider3D = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(Slider3D, _super);
    /**
     * Creates a new slider
     * @param name defines the control name
     * @param sliderBackplateVisible defines if the control has a backplate, default is false
     */
    function Slider3D(name, sliderBackplateVisible) {
        var _this = _super.call(this, name) || this;
        /** Observable raised when the sldier value changes */
        _this.onValueChangedObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Observable();
        _this._sliderBackplateVisible = sliderBackplateVisible || false;
        _this._minimum = SLIDER_MIN;
        _this._maximum = SLIDER_MAX;
        _this._step = SLIDER_STEP;
        _this._value = SLIDER_VAL;
        return _this;
    }
    Object.defineProperty(Slider3D.prototype, "mesh", {
        /**
         * Gets the mesh used to render this control
         */
        get: function () {
            if (this.node) {
                return this._sliderThumb;
            }
            return null;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Slider3D.prototype, "minimum", {
        /** Gets or sets minimum value */
        get: function () {
            return this._minimum;
        },
        set: function (value) {
            if (this._minimum === value) {
                return;
            }
            this._minimum = Math.max(value, SLIDER_MIN);
            this._value = Math.max(Math.min(this._value, this._maximum), this._minimum);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Slider3D.prototype, "maximum", {
        /** Gets or sets maximum value */
        get: function () {
            return this._maximum;
        },
        set: function (value) {
            if (this._maximum === value) {
                return;
            }
            this._maximum = Math.max(value, this._minimum);
            this._value = Math.max(Math.min(this._value, this._maximum), this._minimum);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Slider3D.prototype, "step", {
        /** Gets or sets step value */
        get: function () {
            return this._step;
        },
        set: function (value) {
            if (this._step === value) {
                return;
            }
            this._step = Math.max(Math.min(value, this._maximum - this._minimum), SLIDER_STEP);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Slider3D.prototype, "value", {
        /** Gets or sets current value */
        get: function () {
            return this._value;
        },
        set: function (value) {
            if (this._value === value) {
                return;
            }
            this._value = Math.max(Math.min(value, this._maximum), this._minimum);
            if (this._sliderThumb) {
                this._sliderThumb.position.x = this._convertToPosition(this.value);
            }
            this.onValueChangedObservable.notifyObservers(this._value);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Slider3D.prototype, "start", {
        get: function () {
            if (!this.node) {
                return -SLIDER_SCALING / 2;
            }
            return this._sliderBar.position.x - this._sliderBar.scaling.x / 2;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Slider3D.prototype, "end", {
        get: function () {
            if (!this.node) {
                return SLIDER_SCALING / 2;
            }
            return this._sliderBar.position.x + this._sliderBar.scaling.x / 2;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Slider3D.prototype, "sliderBarMaterial", {
        /**
         * Gets the slider bar material used by this control
         */
        get: function () {
            return this._sliderBarMaterial;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Slider3D.prototype, "sliderThumbMaterial", {
        /**
         * Gets the slider thumb material used by this control
         */
        get: function () {
            return this._sliderThumbMaterial;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Slider3D.prototype, "sliderBackplateMaterial", {
        /**
         * Gets the slider backplate material used by this control
         */
        get: function () {
            return this._sliderBackplateMaterial;
        },
        enumerable: false,
        configurable: true
    });
    // Mesh association
    Slider3D.prototype._createNode = function (scene) {
        var _this = this;
        var sliderBackplate = (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.CreateBox)("".concat(this.name, "_sliderbackplate"), {
            width: 1.0,
            height: 1.0,
            depth: 1.0,
        }, scene);
        sliderBackplate.isPickable = false;
        sliderBackplate.visibility = 0;
        sliderBackplate.scaling = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Vector3(1, 0.5, 0.8);
        core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.SceneLoader.ImportMeshAsync(undefined, Slider3D.MODEL_BASE_URL, Slider3D.MODEL_FILENAME, scene).then(function (result) {
            var sliderBackplateModel = result.meshes[1];
            var sliderBarModel = result.meshes[1].clone("".concat(_this.name, "_sliderbar"), sliderBackplate);
            var sliderThumbModel = result.meshes[1].clone("".concat(_this.name, "_sliderthumb"), sliderBackplate);
            sliderBackplateModel.visibility = 0;
            if (_this._sliderBackplateVisible) {
                sliderBackplateModel.visibility = 1;
                sliderBackplateModel.name = "".concat(_this.name, "_sliderbackplate");
                sliderBackplateModel.isPickable = false;
                sliderBackplateModel.scaling.x = 1;
                sliderBackplateModel.scaling.z = 0.2;
                sliderBackplateModel.parent = sliderBackplate;
                if (_this._sliderBackplateMaterial) {
                    sliderBackplateModel.material = _this._sliderBackplateMaterial;
                }
                _this._sliderBackplate = sliderBackplateModel;
            }
            if (sliderBarModel) {
                sliderBarModel.parent = sliderBackplate;
                sliderBarModel.position.z = -0.1;
                sliderBarModel.scaling = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Vector3(SLIDER_SCALING - SLIDER_MARGIN, 0.04, 0.3);
                sliderBarModel.isPickable = false;
                if (_this._sliderBarMaterial) {
                    sliderBarModel.material = _this._sliderBarMaterial;
                }
                _this._sliderBar = sliderBarModel;
            }
            if (sliderThumbModel) {
                sliderThumbModel.parent = sliderBackplate;
                sliderThumbModel.isPickable = true;
                sliderThumbModel.position.z = -0.115;
                sliderThumbModel.scaling = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Vector3(0.025, 0.3, 0.6);
                sliderThumbModel.position.x = _this._convertToPosition(_this.value);
                sliderThumbModel.addBehavior(_this._createBehavior());
                if (_this._sliderThumbMaterial) {
                    sliderThumbModel.material = _this._sliderThumbMaterial;
                }
                _this._sliderThumb = sliderThumbModel;
            }
        });
        this._affectMaterial(sliderBackplate);
        return sliderBackplate;
    };
    Slider3D.prototype._affectMaterial = function (mesh) {
        var _a, _b, _c;
        this._sliderBackplateMaterial = (_a = this._sliderBackplateMaterial) !== null && _a !== void 0 ? _a : new _materials_mrdl_mrdlBackplateMaterial__WEBPACK_IMPORTED_MODULE_5__.MRDLBackplateMaterial("".concat(this.name, "_sliderbackplate_material"), mesh.getScene());
        this._sliderBarMaterial = (_b = this._sliderBarMaterial) !== null && _b !== void 0 ? _b : new _materials_mrdl_mrdlSliderBarMaterial__WEBPACK_IMPORTED_MODULE_3__.MRDLSliderBarMaterial("".concat(this.name, "_sliderbar_material"), mesh.getScene());
        this._sliderThumbMaterial = (_c = this._sliderThumbMaterial) !== null && _c !== void 0 ? _c : new _materials_mrdl_mrdlSliderThumbMaterial__WEBPACK_IMPORTED_MODULE_4__.MRDLSliderThumbMaterial("".concat(this.name, "_sliderthumb_material"), mesh.getScene());
    };
    Slider3D.prototype._createBehavior = function () {
        var _this = this;
        var pointerDragBehavior = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.PointerDragBehavior({ dragAxis: core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Vector3.Right() });
        pointerDragBehavior.moveAttached = false;
        pointerDragBehavior.onDragStartObservable.add(function () {
            _this._draggedPosition = _this._sliderThumb.position.x;
        });
        pointerDragBehavior.onDragObservable.add(function (event) {
            _this._draggedPosition += event.dragDistance / _this.scaling.x;
            _this.value = _this._convertToValue(_this._draggedPosition);
        });
        return pointerDragBehavior;
    };
    Slider3D.prototype._convertToPosition = function (value) {
        var position = ((value - this.minimum) / (this.maximum - this.minimum)) * (this.end - this.start) + this.start;
        return Math.min(Math.max(position, this.start), this.end);
    };
    Slider3D.prototype._convertToValue = function (position) {
        var value = ((position - this.start) / (this.end - this.start)) * (this.maximum - this.minimum);
        value = this.step ? Math.round(value / this.step) * this.step : value;
        return Math.max(Math.min(this.minimum + value, this._maximum), this._minimum);
    };
    /**
     * Releases all associated resources
     */
    Slider3D.prototype.dispose = function () {
        var _a, _b, _c, _d, _e, _f;
        _super.prototype.dispose.call(this);
        (_a = this._sliderBar) === null || _a === void 0 ? void 0 : _a.dispose();
        (_b = this._sliderThumb) === null || _b === void 0 ? void 0 : _b.dispose();
        (_c = this._sliderBarMaterial) === null || _c === void 0 ? void 0 : _c.dispose();
        (_d = this._sliderThumbMaterial) === null || _d === void 0 ? void 0 : _d.dispose();
        (_e = this._sliderBackplate) === null || _e === void 0 ? void 0 : _e.dispose();
        (_f = this._sliderBackplateMaterial) === null || _f === void 0 ? void 0 : _f.dispose();
    };
    /**
     * Base Url for the models.
     */
    Slider3D.MODEL_BASE_URL = "https://assets.babylonjs.com/meshes/MRTK/";
    /**
     * File name for the 8x4 model.
     */
    Slider3D.MODEL_FILENAME = "mrtk-fluent-backplate.glb";
    return Slider3D;
}(_control3D__WEBPACK_IMPORTED_MODULE_2__.Control3D));



/***/ }),

/***/ "../../../lts/gui/dist/3D/controls/spherePanel.js":
/*!********************************************************!*\
  !*** ../../../lts/gui/dist/3D/controls/spherePanel.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "SpherePanel": () => (/* binding */ SpherePanel)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Maths/math.axis */ "core/Misc/observable");
/* harmony import */ var core_Misc_tools__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _volumeBasedPanel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./volumeBasedPanel */ "../../../lts/gui/dist/3D/controls/volumeBasedPanel.js");
/* harmony import */ var _container3D__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./container3D */ "../../../lts/gui/dist/3D/controls/container3D.js");






/**
 * Class used to create a container panel deployed on the surface of a sphere
 */
var SpherePanel = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(SpherePanel, _super);
    function SpherePanel() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this._radius = 5.0;
        return _this;
    }
    Object.defineProperty(SpherePanel.prototype, "radius", {
        /**
         * Gets or sets the radius of the sphere where to project controls (5 by default)
         */
        get: function () {
            return this._radius;
        },
        set: function (value) {
            var _this = this;
            if (this._radius === value) {
                return;
            }
            this._radius = value;
            core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.Tools.SetImmediate(function () {
                _this._arrangeChildren();
            });
        },
        enumerable: false,
        configurable: true
    });
    SpherePanel.prototype._mapGridNode = function (control, nodePosition) {
        var mesh = control.mesh;
        if (!mesh) {
            return;
        }
        var newPos = this._sphericalMapping(nodePosition);
        control.position = newPos;
        switch (this.orientation) {
            case _container3D__WEBPACK_IMPORTED_MODULE_3__.Container3D.FACEORIGIN_ORIENTATION:
                mesh.lookAt(new core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.Vector3(2 * newPos.x, 2 * newPos.y, 2 * newPos.z));
                break;
            case _container3D__WEBPACK_IMPORTED_MODULE_3__.Container3D.FACEORIGINREVERSED_ORIENTATION:
                mesh.lookAt(new core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.Vector3(-newPos.x, -newPos.y, -newPos.z));
                break;
            case _container3D__WEBPACK_IMPORTED_MODULE_3__.Container3D.FACEFORWARD_ORIENTATION:
                break;
            case _container3D__WEBPACK_IMPORTED_MODULE_3__.Container3D.FACEFORWARDREVERSED_ORIENTATION:
                mesh.rotate(core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.Axis.Y, Math.PI, core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.Space.LOCAL);
                break;
        }
    };
    SpherePanel.prototype._sphericalMapping = function (source) {
        var newPos = new core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.Vector3(0, 0, this._radius);
        var xAngle = source.y / this._radius;
        var yAngle = -(source.x / this._radius);
        core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.Matrix.RotationYawPitchRollToRef(yAngle, xAngle, 0, core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.TmpVectors.Matrix[0]);
        return core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.Vector3.TransformNormal(newPos, core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.TmpVectors.Matrix[0]);
    };
    return SpherePanel;
}(_volumeBasedPanel__WEBPACK_IMPORTED_MODULE_2__.VolumeBasedPanel));



/***/ }),

/***/ "../../../lts/gui/dist/3D/controls/stackPanel3D.js":
/*!*********************************************************!*\
  !*** ../../../lts/gui/dist/3D/controls/stackPanel3D.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "StackPanel3D": () => (/* binding */ StackPanel3D)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Maths/math.vector */ "core/Misc/observable");
/* harmony import */ var core_Misc_tools__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _container3D__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./container3D */ "../../../lts/gui/dist/3D/controls/container3D.js");




/**
 * Class used to create a stack panel in 3D on XY plane
 */
var StackPanel3D = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(StackPanel3D, _super);
    /**
     * Creates new StackPanel
     * @param isVertical
     */
    function StackPanel3D(isVertical) {
        if (isVertical === void 0) { isVertical = false; }
        var _this = _super.call(this) || this;
        _this._isVertical = false;
        /**
         * Gets or sets the distance between elements
         */
        _this.margin = 0.1;
        _this._isVertical = isVertical;
        return _this;
    }
    Object.defineProperty(StackPanel3D.prototype, "isVertical", {
        /**
         * Gets or sets a boolean indicating if the stack panel is vertical or horizontal (horizontal by default)
         */
        get: function () {
            return this._isVertical;
        },
        set: function (value) {
            var _this = this;
            if (this._isVertical === value) {
                return;
            }
            this._isVertical = value;
            core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.Tools.SetImmediate(function () {
                _this._arrangeChildren();
            });
        },
        enumerable: false,
        configurable: true
    });
    StackPanel3D.prototype._arrangeChildren = function () {
        var width = 0;
        var height = 0;
        var controlCount = 0;
        var extendSizes = [];
        var currentInverseWorld = core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.Matrix.Invert(this.node.computeWorldMatrix(true));
        // Measure
        for (var _i = 0, _a = this._children; _i < _a.length; _i++) {
            var child = _a[_i];
            if (!child.mesh) {
                continue;
            }
            controlCount++;
            child.mesh.computeWorldMatrix(true);
            child.mesh.getWorldMatrix().multiplyToRef(currentInverseWorld, core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.TmpVectors.Matrix[0]);
            var boundingBox = child.mesh.getBoundingInfo().boundingBox;
            var extendSize = core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.Vector3.TransformNormal(boundingBox.extendSize, core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.TmpVectors.Matrix[0]);
            extendSizes.push(extendSize);
            if (this._isVertical) {
                height += extendSize.y;
            }
            else {
                width += extendSize.x;
            }
        }
        if (this._isVertical) {
            height += ((controlCount - 1) * this.margin) / 2;
        }
        else {
            width += ((controlCount - 1) * this.margin) / 2;
        }
        // Arrange
        var offset;
        if (this._isVertical) {
            offset = -height;
        }
        else {
            offset = -width;
        }
        var index = 0;
        for (var _b = 0, _c = this._children; _b < _c.length; _b++) {
            var child = _c[_b];
            if (!child.mesh) {
                continue;
            }
            controlCount--;
            var extendSize = extendSizes[index++];
            if (this._isVertical) {
                child.position.y = offset + extendSize.y;
                child.position.x = 0;
                offset += extendSize.y * 2;
            }
            else {
                child.position.x = offset + extendSize.x;
                child.position.y = 0;
                offset += extendSize.x * 2;
            }
            offset += controlCount > 0 ? this.margin : 0;
        }
    };
    return StackPanel3D;
}(_container3D__WEBPACK_IMPORTED_MODULE_2__.Container3D));



/***/ }),

/***/ "../../../lts/gui/dist/3D/controls/touchButton3D.js":
/*!**********************************************************!*\
  !*** ../../../lts/gui/dist/3D/controls/touchButton3D.js ***!
  \**********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "TouchButton3D": () => (/* binding */ TouchButton3D)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Misc/observable */ "core/Misc/observable");
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _button3D__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./button3D */ "../../../lts/gui/dist/3D/controls/button3D.js");
// Assumptions: absolute position of button mesh is inside the mesh





/**
 * Class used to create a touchable button in 3D
 */
var TouchButton3D = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(TouchButton3D, _super);
    /**
     * Creates a new touchable button
     * @param name defines the control name
     * @param collisionMesh mesh to track collisions with
     */
    function TouchButton3D(name, collisionMesh) {
        var _this = _super.call(this, name) || this;
        _this._isNearPressed = false;
        _this._interactionSurfaceHeight = 0;
        _this._isToggleButton = false;
        _this._toggleState = false;
        _this._toggleButtonCallback = function () {
            _this._onToggle(!_this._toggleState);
        };
        /**
         * An event triggered when the button is toggled. Only fired if 'isToggleButton' is true
         */
        _this.onToggleObservable = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Observable();
        _this.collidableFrontDirection = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Vector3.Zero();
        if (collisionMesh) {
            _this.collisionMesh = collisionMesh;
        }
        return _this;
    }
    Object.defineProperty(TouchButton3D.prototype, "isActiveNearInteraction", {
        /**
         * Whether the current interaction is caused by near interaction or not
         */
        get: function () {
            return this._isNearPressed;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(TouchButton3D.prototype, "collidableFrontDirection", {
        /**
         * Returns the front-facing direction of the button, or Vector3.Zero if there is no 'front'
         */
        get: function () {
            if (this._collisionMesh) {
                // Update the front direction to reflect any rotations of the collision mesh
                var transformedDirection = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.TmpVectors.Vector3[0];
                core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Vector3.TransformNormalToRef(this._collidableFrontDirection, this._collisionMesh.getWorldMatrix(), transformedDirection);
                return transformedDirection.normalize();
            }
            return this._collidableFrontDirection;
        },
        /**
         * Sets the front-facing direction of the button. Pass in Vector3.Zero to allow interactions from any direction
         * @param frontWorldDir the forward direction of the button
         */
        set: function (frontWorldDir) {
            this._collidableFrontDirection = frontWorldDir.normalize();
            if (this._collisionMesh) {
                var invert = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.TmpVectors.Matrix[0];
                invert.copyFrom(this._collisionMesh.getWorldMatrix());
                invert.invert();
                core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Vector3.TransformNormalToRef(this._collidableFrontDirection, invert, this._collidableFrontDirection);
                this._collidableFrontDirection.normalize();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(TouchButton3D.prototype, "collisionMesh", {
        /**
         * Sets the mesh used for testing input collision
         * @param collisionMesh the new collision mesh for the button
         */
        set: function (collisionMesh) {
            var _this = this;
            var _a;
            // Remove the GUI3DManager's data from the previous collision mesh's reserved data store, and reset interactability
            if (this._collisionMesh) {
                this._collisionMesh.isNearPickable = false;
                if ((_a = this._collisionMesh.reservedDataStore) === null || _a === void 0 ? void 0 : _a.GUI3D) {
                    this._collisionMesh.reservedDataStore.GUI3D = {};
                }
                this._collisionMesh.getChildMeshes().forEach(function (mesh) {
                    var _a;
                    mesh.isNearPickable = false;
                    if ((_a = mesh.reservedDataStore) === null || _a === void 0 ? void 0 : _a.GUI3D) {
                        mesh.reservedDataStore.GUI3D = {};
                    }
                });
            }
            this._collisionMesh = collisionMesh;
            this._injectGUI3DReservedDataStore(this._collisionMesh).control = this;
            this._collisionMesh.isNearPickable = true;
            this._collisionMesh.getChildMeshes().forEach(function (mesh) {
                _this._injectGUI3DReservedDataStore(mesh).control = _this;
                mesh.isNearPickable = true;
            });
            this.collidableFrontDirection = collisionMesh.forward;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(TouchButton3D.prototype, "isToggleButton", {
        get: function () {
            return this._isToggleButton;
        },
        /**
         * Setter for if this TouchButton3D should be treated as a toggle button
         * @param value If this TouchHolographicButton should act like a toggle button
         */
        set: function (value) {
            if (value === this._isToggleButton) {
                return;
            }
            this._isToggleButton = value;
            if (value) {
                this.onPointerUpObservable.add(this._toggleButtonCallback);
            }
            else {
                this.onPointerUpObservable.removeCallback(this._toggleButtonCallback);
                // Safety check, reset the button if it's toggled on but no longer a toggle button
                if (this._toggleState) {
                    this._onToggle(false);
                }
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(TouchButton3D.prototype, "isToggled", {
        get: function () {
            return this._toggleState;
        },
        /**
         * A public entrypoint to set the toggle state of the TouchHolographicButton. Only works if 'isToggleButton' is true
         * @param newState The new state to set the TouchHolographicButton's toggle state to
         */
        set: function (newState) {
            if (this._isToggleButton && this._toggleState !== newState) {
                this._onToggle(newState);
            }
        },
        enumerable: false,
        configurable: true
    });
    TouchButton3D.prototype._onToggle = function (newState) {
        this._toggleState = newState;
        this.onToggleObservable.notifyObservers(newState);
    };
    // Returns true if the collidable is in front of the button, or if the button has no front direction
    TouchButton3D.prototype._isInteractionInFrontOfButton = function (collidablePos) {
        return this._getInteractionHeight(collidablePos, this._collisionMesh.getAbsolutePosition()) > 0;
    };
    /**
     * Get the height of the touchPoint from the collidable part of the button
     * @param touchPoint the point to compare to the button, in absolute position
     * @returns the depth of the touch point into the front of the button
     */
    TouchButton3D.prototype.getPressDepth = function (touchPoint) {
        if (!this._isNearPressed) {
            return 0;
        }
        var interactionHeight = this._getInteractionHeight(touchPoint, this._collisionMesh.getAbsolutePosition());
        return this._interactionSurfaceHeight - interactionHeight;
    };
    // Returns true if the collidable is in front of the button, or if the button has no front direction
    TouchButton3D.prototype._getInteractionHeight = function (interactionPos, basePos) {
        var frontDir = this.collidableFrontDirection;
        if (frontDir.length() === 0) {
            // The button has no front, just return the distance to the base
            return core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Vector3.Distance(interactionPos, basePos);
        }
        var d = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Vector3.Dot(basePos, frontDir);
        var abc = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Vector3.Dot(interactionPos, frontDir);
        return abc - d;
    };
    /**
     * @param providedType
     * @param nearMeshPosition
     * @param activeInteractionCount
     * @hidden
     */
    TouchButton3D.prototype._generatePointerEventType = function (providedType, nearMeshPosition, activeInteractionCount) {
        if (providedType === core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.PointerEventTypes.POINTERDOWN) {
            if (!this._isInteractionInFrontOfButton(nearMeshPosition)) {
                // Near interaction mesh is behind the button, don't send a pointer down
                return core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.PointerEventTypes.POINTERMOVE;
            }
            else {
                this._isNearPressed = true;
                this._interactionSurfaceHeight = this._getInteractionHeight(nearMeshPosition, this._collisionMesh.getAbsolutePosition());
            }
        }
        if (providedType === core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.PointerEventTypes.POINTERUP) {
            if (activeInteractionCount == 0) {
                // We get the release for the down we swallowed earlier, swallow as well
                return core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.PointerEventTypes.POINTERMOVE;
            }
            else {
                this._isNearPressed = false;
            }
        }
        return providedType;
    };
    TouchButton3D.prototype._getTypeName = function () {
        return "TouchButton3D";
    };
    // Mesh association
    TouchButton3D.prototype._createNode = function (scene) {
        return _super.prototype._createNode.call(this, scene);
    };
    /**
     * Releases all associated resources
     */
    TouchButton3D.prototype.dispose = function () {
        _super.prototype.dispose.call(this);
        // Clean up toggle observables
        this.onPointerUpObservable.removeCallback(this._toggleButtonCallback);
        this.onToggleObservable.clear();
        if (this._collisionMesh) {
            this._collisionMesh.dispose();
        }
    };
    return TouchButton3D;
}(_button3D__WEBPACK_IMPORTED_MODULE_2__.Button3D));



/***/ }),

/***/ "../../../lts/gui/dist/3D/controls/touchHolographicButton.js":
/*!*******************************************************************!*\
  !*** ../../../lts/gui/dist/3D/controls/touchHolographicButton.js ***!
  \*******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "TouchHolographicButton": () => (/* binding */ TouchHolographicButton)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Maths/math.scalar */ "core/Misc/observable");
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _materials_fluent_fluentMaterial__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../materials/fluent/fluentMaterial */ "../../../lts/gui/dist/3D/materials/fluent/fluentMaterial.js");
/* harmony import */ var _materials_fluentButton_fluentButtonMaterial__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../materials/fluentButton/fluentButtonMaterial */ "../../../lts/gui/dist/3D/materials/fluentButton/fluentButtonMaterial.js");
/* harmony import */ var _2D_controls_stackPanel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../2D/controls/stackPanel */ "../../../lts/gui/dist/2D/controls/stackPanel.js");
/* harmony import */ var _2D_controls_image__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../2D/controls/image */ "../../../lts/gui/dist/2D/controls/image.js");
/* harmony import */ var _2D_controls_textBlock__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../2D/controls/textBlock */ "../../../lts/gui/dist/2D/controls/textBlock.js");
/* harmony import */ var _2D_advancedDynamicTexture__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../2D/advancedDynamicTexture */ "../../../lts/gui/dist/2D/advancedDynamicTexture.js");
/* harmony import */ var _touchButton3D__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./touchButton3D */ "../../../lts/gui/dist/3D/controls/touchButton3D.js");



















/**
 * Class used to create a holographic button in 3D
 * @since 5.0.0
 */
var TouchHolographicButton = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(TouchHolographicButton, _super);
    /**
     * Creates a new button
     * @param name defines the control name
     * @param shareMaterials
     */
    function TouchHolographicButton(name, shareMaterials) {
        if (shareMaterials === void 0) { shareMaterials = true; }
        var _this = _super.call(this, name) || this;
        _this._shareMaterials = true;
        _this._isBackplateVisible = true;
        _this._frontPlateDepth = 0.5;
        _this._backPlateDepth = 0.04;
        _this._backplateColor = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Color3(0.08, 0.15, 0.55);
        _this._backplateToggledColor = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Color3(0.25, 0.4, 0.95);
        _this._shareMaterials = shareMaterials;
        _this.pointerEnterAnimation = function () {
            _this._frontMaterial.leftBlobEnable = true;
            _this._frontMaterial.rightBlobEnable = true;
        };
        _this.pointerOutAnimation = function () {
            _this._frontMaterial.leftBlobEnable = false;
            _this._frontMaterial.rightBlobEnable = false;
        };
        _this.pointerDownAnimation = function () {
            if (_this._frontPlate && !_this.isActiveNearInteraction) {
                _this._frontPlate.scaling.z = _this._frontPlateDepth * 0.2;
                _this._frontPlate.position = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Vector3.Forward(_this._frontPlate._scene.useRightHandedSystem).scale((_this._frontPlateDepth - 0.2 * _this._frontPlateDepth) / 2);
                _this._textPlate.position = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Vector3.Forward(_this._textPlate._scene.useRightHandedSystem).scale(-(_this._backPlateDepth + 0.2 * _this._frontPlateDepth) / 2);
            }
        };
        _this.pointerUpAnimation = function () {
            if (_this._frontPlate) {
                _this._frontPlate.scaling.z = _this._frontPlateDepth;
                _this._frontPlate.position = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Vector3.Forward(_this._frontPlate._scene.useRightHandedSystem).scale((_this._frontPlateDepth - _this._frontPlateDepth) / 2);
                _this._textPlate.position = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Vector3.Forward(_this._textPlate._scene.useRightHandedSystem).scale(-(_this._backPlateDepth + _this._frontPlateDepth) / 2);
            }
        };
        _this.onPointerMoveObservable.add(function (position) {
            if (_this._frontPlate && _this.isActiveNearInteraction) {
                var scale = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Vector3.Zero();
                if (_this._backPlate.getWorldMatrix().decompose(scale, undefined, undefined)) {
                    var interactionHeight = _this._getInteractionHeight(position, _this._backPlate.getAbsolutePosition()) / scale.z;
                    interactionHeight = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Scalar.Clamp(interactionHeight - _this._backPlateDepth / 2, 0.2 * _this._frontPlateDepth, _this._frontPlateDepth);
                    _this._frontPlate.scaling.z = interactionHeight;
                    _this._frontPlate.position = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Vector3.Forward(_this._frontPlate._scene.useRightHandedSystem).scale((_this._frontPlateDepth - interactionHeight) / 2);
                    _this._textPlate.position = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Vector3.Forward(_this._textPlate._scene.useRightHandedSystem).scale(-(_this._backPlateDepth + interactionHeight) / 2);
                }
            }
        });
        _this._pointerHoverObserver = _this.onPointerMoveObservable.add(function (hoverPosition) {
            _this._frontMaterial.globalLeftIndexTipPosition = hoverPosition;
        });
        return _this;
    }
    TouchHolographicButton.prototype._disposeTooltip = function () {
        this._tooltipFade = null;
        if (this._tooltipTextBlock) {
            this._tooltipTextBlock.dispose();
        }
        if (this._tooltipTexture) {
            this._tooltipTexture.dispose();
        }
        if (this._tooltipMesh) {
            this._tooltipMesh.dispose();
        }
        this.onPointerEnterObservable.remove(this._tooltipHoverObserver);
        this.onPointerOutObservable.remove(this._tooltipOutObserver);
    };
    Object.defineProperty(TouchHolographicButton.prototype, "renderingGroupId", {
        get: function () {
            return this._backPlate.renderingGroupId;
        },
        /**
         * Rendering ground id of all the mesh in the button
         */
        set: function (id) {
            this._backPlate.renderingGroupId = id;
            this._textPlate.renderingGroupId = id;
            this._frontPlate.renderingGroupId = id;
            if (this._tooltipMesh) {
                this._tooltipMesh.renderingGroupId = id;
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(TouchHolographicButton.prototype, "mesh", {
        /**
         * Gets the mesh used to render this control
         */
        get: function () {
            return this._backPlate;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(TouchHolographicButton.prototype, "tooltipText", {
        get: function () {
            if (this._tooltipTextBlock) {
                return this._tooltipTextBlock.text;
            }
            return null;
        },
        /**
         * Text to be displayed on the tooltip shown when hovering on the button. When set to null tooltip is disabled. (Default: null)
         */
        set: function (text) {
            var _this = this;
            if (!text) {
                this._disposeTooltip();
                return;
            }
            if (!this._tooltipFade) {
                var rightHandedScene = this._backPlate._scene.useRightHandedSystem;
                // Create tooltip with mesh and text
                this._tooltipMesh = (0,core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.CreatePlane)("", { size: 1 }, this._backPlate._scene);
                var tooltipBackground = (0,core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.CreatePlane)("", { size: 1, sideOrientation: core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Mesh.DOUBLESIDE }, this._backPlate._scene);
                var mat = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.StandardMaterial("", this._backPlate._scene);
                mat.diffuseColor = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Color3.FromHexString("#212121");
                tooltipBackground.material = mat;
                tooltipBackground.isPickable = false;
                this._tooltipMesh.addChild(tooltipBackground);
                tooltipBackground.position = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Vector3.Forward(rightHandedScene).scale(0.05);
                this._tooltipMesh.scaling.y = 1 / 3;
                this._tooltipMesh.position = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Vector3.Up().scale(0.7).add(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Vector3.Forward(rightHandedScene).scale(-0.15));
                this._tooltipMesh.isPickable = false;
                this._tooltipMesh.parent = this._backPlate;
                // Create text texture for the tooltip
                this._tooltipTexture = _2D_advancedDynamicTexture__WEBPACK_IMPORTED_MODULE_7__.AdvancedDynamicTexture.CreateForMesh(this._tooltipMesh);
                this._tooltipTextBlock = new _2D_controls_textBlock__WEBPACK_IMPORTED_MODULE_6__.TextBlock();
                this._tooltipTextBlock.scaleY = 3;
                this._tooltipTextBlock.color = "white";
                this._tooltipTextBlock.fontSize = 130;
                this._tooltipTexture.addControl(this._tooltipTextBlock);
                // Add hover action to tooltip
                this._tooltipFade = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.FadeInOutBehavior();
                this._tooltipFade.delay = 500;
                this._tooltipMesh.addBehavior(this._tooltipFade);
                this._tooltipHoverObserver = this.onPointerEnterObservable.add(function () {
                    if (_this._tooltipFade) {
                        _this._tooltipFade.fadeIn(true);
                    }
                });
                this._tooltipOutObserver = this.onPointerOutObservable.add(function () {
                    if (_this._tooltipFade) {
                        _this._tooltipFade.fadeIn(false);
                    }
                });
            }
            if (this._tooltipTextBlock) {
                this._tooltipTextBlock.text = text;
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(TouchHolographicButton.prototype, "text", {
        /**
         * Gets or sets text for the button
         */
        get: function () {
            return this._text;
        },
        set: function (value) {
            if (this._text === value) {
                return;
            }
            this._text = value;
            this._rebuildContent();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(TouchHolographicButton.prototype, "imageUrl", {
        /**
         * Gets or sets the image url for the button
         */
        get: function () {
            return this._imageUrl;
        },
        set: function (value) {
            if (this._imageUrl === value) {
                return;
            }
            this._imageUrl = value;
            this._rebuildContent();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(TouchHolographicButton.prototype, "backMaterial", {
        /**
         * Gets the back material used by this button
         */
        get: function () {
            return this._backMaterial;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(TouchHolographicButton.prototype, "frontMaterial", {
        /**
         * Gets the front material used by this button
         */
        get: function () {
            return this._frontMaterial;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(TouchHolographicButton.prototype, "plateMaterial", {
        /**
         * Gets the plate material used by this button
         */
        get: function () {
            return this._plateMaterial;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(TouchHolographicButton.prototype, "shareMaterials", {
        /**
         * Gets a boolean indicating if this button shares its material with other HolographicButtons
         */
        get: function () {
            return this._shareMaterials;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(TouchHolographicButton.prototype, "isBackplateVisible", {
        /**
         * Sets whether the backplate is visible or hidden. Hiding the backplate is not recommended without some sort of replacement
         */
        set: function (isVisible) {
            if (this.mesh && !!this._backMaterial) {
                if (isVisible && !this._isBackplateVisible) {
                    this._backPlate.visibility = 1;
                }
                else if (!isVisible && this._isBackplateVisible) {
                    this._backPlate.visibility = 0;
                }
            }
            this._isBackplateVisible = isVisible;
        },
        enumerable: false,
        configurable: true
    });
    TouchHolographicButton.prototype._getTypeName = function () {
        return "TouchHolographicButton";
    };
    TouchHolographicButton.prototype._rebuildContent = function () {
        this._disposeFacadeTexture();
        var panel = new _2D_controls_stackPanel__WEBPACK_IMPORTED_MODULE_4__.StackPanel();
        panel.isVertical = true;
        if (core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.DomManagement.IsDocumentAvailable() && !!document.createElement) {
            if (this._imageUrl) {
                var image = new _2D_controls_image__WEBPACK_IMPORTED_MODULE_5__.Image();
                image.source = this._imageUrl;
                image.paddingTop = "40px";
                image.height = "180px";
                image.width = "100px";
                image.paddingBottom = "40px";
                panel.addControl(image);
            }
        }
        if (this._text) {
            var text = new _2D_controls_textBlock__WEBPACK_IMPORTED_MODULE_6__.TextBlock();
            text.text = this._text;
            text.color = "white";
            text.height = "30px";
            text.fontSize = 24;
            panel.addControl(text);
        }
        this.content = panel;
    };
    // Mesh association
    TouchHolographicButton.prototype._createNode = function (scene) {
        var _this = this;
        var _a;
        this.name = (_a = this.name) !== null && _a !== void 0 ? _a : "TouchHolographicButton";
        var collisionMesh = (0,core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.CreateBox)("".concat(this.name, "_collisionMesh"), {
            width: 1.0,
            height: 1.0,
            depth: this._frontPlateDepth,
        }, scene);
        collisionMesh.isPickable = true;
        collisionMesh.isNearPickable = true;
        collisionMesh.visibility = 0;
        collisionMesh.position = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Vector3.Forward(scene.useRightHandedSystem).scale(-this._frontPlateDepth / 2);
        core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.SceneLoader.ImportMeshAsync(undefined, TouchHolographicButton.MODEL_BASE_URL, TouchHolographicButton.MODEL_FILENAME, scene).then(function (result) {
            var alphaMesh = (0,core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.CreateBox)("${this.name}_alphaMesh", {
                width: 1.0,
                height: 1.0,
                depth: 1.0,
            }, scene);
            alphaMesh.isPickable = false;
            alphaMesh.material = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.StandardMaterial("${this.name}_alphaMesh_material", scene);
            alphaMesh.material.alpha = 0.15;
            var importedFrontPlate = result.meshes[1];
            importedFrontPlate.name = "".concat(_this.name, "_frontPlate");
            importedFrontPlate.isPickable = false;
            importedFrontPlate.scaling.z = _this._frontPlateDepth;
            alphaMesh.parent = importedFrontPlate;
            importedFrontPlate.parent = collisionMesh;
            if (_this._frontMaterial) {
                importedFrontPlate.material = _this._frontMaterial;
            }
            _this._frontPlate = importedFrontPlate;
        });
        this._backPlate = (0,core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.CreateBox)("".concat(this.name, "_backPlate"), {
            width: 1.0,
            height: 1.0,
            depth: this._backPlateDepth,
        }, scene);
        this._backPlate.position = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Vector3.Forward(scene.useRightHandedSystem).scale(this._backPlateDepth / 2);
        this._backPlate.isPickable = false;
        this._textPlate = _super.prototype._createNode.call(this, scene);
        this._textPlate.name = "".concat(this.name, "_textPlate");
        this._textPlate.isPickable = false;
        this._textPlate.position = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Vector3.Forward(scene.useRightHandedSystem).scale(-this._frontPlateDepth / 2);
        this._backPlate.addChild(collisionMesh);
        this._backPlate.addChild(this._textPlate);
        var tn = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.TransformNode("{this.name}_root", scene);
        this._backPlate.setParent(tn);
        this.collisionMesh = collisionMesh;
        this.collidableFrontDirection = this._backPlate.forward.negate(); // Mesh is facing the wrong way
        return tn;
    };
    TouchHolographicButton.prototype._applyFacade = function (facadeTexture) {
        this._plateMaterial.emissiveTexture = facadeTexture;
        this._plateMaterial.opacityTexture = facadeTexture;
        this._plateMaterial.diffuseColor = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Color3(0.4, 0.4, 0.4);
    };
    TouchHolographicButton.prototype._createBackMaterial = function (mesh) {
        this._backMaterial = new _materials_fluent_fluentMaterial__WEBPACK_IMPORTED_MODULE_2__.FluentMaterial(this.name + "backPlateMaterial", mesh.getScene());
        this._backMaterial.albedoColor = this._backplateColor;
        this._backMaterial.renderBorders = true;
        this._backMaterial.renderHoverLight = false;
    };
    TouchHolographicButton.prototype._createFrontMaterial = function (mesh) {
        this._frontMaterial = new _materials_fluentButton_fluentButtonMaterial__WEBPACK_IMPORTED_MODULE_3__.FluentButtonMaterial(this.name + "Front Material", mesh.getScene());
    };
    TouchHolographicButton.prototype._createPlateMaterial = function (mesh) {
        this._plateMaterial = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.StandardMaterial(this.name + "Plate Material", mesh.getScene());
        this._plateMaterial.specularColor = core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Color3.Black();
    };
    TouchHolographicButton.prototype._onToggle = function (newState) {
        if (this._backMaterial) {
            if (newState) {
                this._backMaterial.albedoColor = this._backplateToggledColor;
            }
            else {
                this._backMaterial.albedoColor = this._backplateColor;
            }
        }
        _super.prototype._onToggle.call(this, newState);
    };
    TouchHolographicButton.prototype._affectMaterial = function (mesh) {
        if (this._shareMaterials) {
            // Back
            if (!this._host._touchSharedMaterials["backFluentMaterial"]) {
                this._createBackMaterial(mesh);
                this._host._touchSharedMaterials["backFluentMaterial"] = this._backMaterial;
            }
            else {
                this._backMaterial = this._host._touchSharedMaterials["backFluentMaterial"];
            }
            // Front
            if (!this._host._touchSharedMaterials["frontFluentMaterial"]) {
                this._createFrontMaterial(mesh);
                this._host._touchSharedMaterials["frontFluentMaterial"] = this._frontMaterial;
            }
            else {
                this._frontMaterial = this._host._touchSharedMaterials["frontFluentMaterial"];
            }
        }
        else {
            this._createBackMaterial(mesh);
            this._createFrontMaterial(mesh);
        }
        this._createPlateMaterial(mesh);
        this._backPlate.material = this._backMaterial;
        this._textPlate.material = this._plateMaterial;
        if (!this._isBackplateVisible) {
            this._backPlate.visibility = 0;
        }
        if (this._frontPlate) {
            this._frontPlate.material = this._frontMaterial;
        }
        this._rebuildContent();
    };
    /**
     * Releases all associated resources
     */
    TouchHolographicButton.prototype.dispose = function () {
        _super.prototype.dispose.call(this); // will dispose main mesh ie. back plate
        this._disposeTooltip();
        this.onPointerMoveObservable.remove(this._pointerHoverObserver);
        if (!this.shareMaterials) {
            this._backMaterial.dispose();
            this._frontMaterial.dispose();
            this._plateMaterial.dispose();
            if (this._pickedPointObserver) {
                this._host.onPickedPointChangedObservable.remove(this._pickedPointObserver);
                this._pickedPointObserver = null;
            }
        }
    };
    /**
     * Base Url for the button model.
     */
    TouchHolographicButton.MODEL_BASE_URL = "https://assets.babylonjs.com/meshes/MRTK/";
    /**
     * File name for the button model.
     */
    TouchHolographicButton.MODEL_FILENAME = "mrtk-fluent-button.glb";
    return TouchHolographicButton;
}(_touchButton3D__WEBPACK_IMPORTED_MODULE_8__.TouchButton3D));



/***/ }),

/***/ "../../../lts/gui/dist/3D/controls/touchHolographicMenu.js":
/*!*****************************************************************!*\
  !*** ../../../lts/gui/dist/3D/controls/touchHolographicMenu.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "TouchHolographicMenu": () => (/* binding */ TouchHolographicMenu)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var _volumeBasedPanel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./volumeBasedPanel */ "../../../lts/gui/dist/3D/controls/volumeBasedPanel.js");
/* harmony import */ var core_Meshes_mesh__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core/Misc/logger */ "core/Misc/observable");
/* harmony import */ var core_Meshes_mesh__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_Meshes_mesh__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _materials_fluent_fluentMaterial__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../materials/fluent/fluentMaterial */ "../../../lts/gui/dist/3D/materials/fluent/fluentMaterial.js");







/**
 * Simple menu that can contain holographic buttons
 */
var TouchHolographicMenu = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(TouchHolographicMenu, _super);
    /**
     * Creates a holographic menu GUI 3D control
     * @param name name of the menu
     */
    function TouchHolographicMenu(name) {
        var _this = _super.call(this, name) || this;
        _this._backPlateMargin = 1.25;
        return _this;
    }
    Object.defineProperty(TouchHolographicMenu.prototype, "backPlateMargin", {
        /**
         * Gets or sets the margin size of the backplate in button size units.
         * Setting this to 1, will make the backPlate margin the size of 1 button
         */
        get: function () {
            return this._backPlateMargin;
        },
        set: function (value) {
            var _this = this;
            this._backPlateMargin = value;
            if (this._children.length >= 1) {
                this.children.forEach(function (control) {
                    _this._updateCurrentMinMax(control.position);
                });
                this._updateMargins();
            }
        },
        enumerable: false,
        configurable: true
    });
    TouchHolographicMenu.prototype._createNode = function (scene) {
        var node = new core_Meshes_mesh__WEBPACK_IMPORTED_MODULE_2__.Mesh("menu_".concat(this.name), scene);
        this._backPlate = (0,core_Meshes_mesh__WEBPACK_IMPORTED_MODULE_2__.CreateBox)("backPlate" + this.name, { size: 1 }, scene);
        this._backPlate.parent = node;
        return node;
    };
    TouchHolographicMenu.prototype._affectMaterial = function (mesh) {
        var _this = this;
        this._backPlateMaterial = new _materials_fluent_fluentMaterial__WEBPACK_IMPORTED_MODULE_3__.FluentMaterial(this.name + "backPlateMaterial", mesh.getScene());
        this._backPlateMaterial.albedoColor = new core_Meshes_mesh__WEBPACK_IMPORTED_MODULE_2__.Color3(0.08, 0.15, 0.55);
        this._backPlateMaterial.renderBorders = true;
        this._backPlateMaterial.renderHoverLight = true;
        this._pickedPointObserver = this._host.onPickedPointChangedObservable.add(function (pickedPoint) {
            if (pickedPoint) {
                _this._backPlateMaterial.hoverPosition = pickedPoint;
                _this._backPlateMaterial.hoverColor.a = 1.0;
            }
            else {
                _this._backPlateMaterial.hoverColor.a = 0;
            }
        });
        this._backPlate.material = this._backPlateMaterial;
    };
    TouchHolographicMenu.prototype._mapGridNode = function (control, nodePosition) {
        // Simple plane mapping for the menu
        var mesh = control.mesh;
        if (!mesh) {
            return;
        }
        control.position = nodePosition.clone();
        this._updateCurrentMinMax(nodePosition);
    };
    TouchHolographicMenu.prototype._finalProcessing = function () {
        this._updateMargins();
    };
    TouchHolographicMenu.prototype._updateCurrentMinMax = function (nodePosition) {
        if (!this._currentMin) {
            this._currentMin = nodePosition.clone();
            this._currentMax = nodePosition.clone();
        }
        this._currentMin.minimizeInPlace(nodePosition);
        this._currentMax.maximizeInPlace(nodePosition);
    };
    TouchHolographicMenu.prototype._updateMargins = function () {
        if (this._children.length > 0) {
            this._currentMin.addInPlaceFromFloats(-this._cellWidth / 2, -this._cellHeight / 2, 0);
            this._currentMax.addInPlaceFromFloats(this._cellWidth / 2, this._cellHeight / 2, 0);
            var extendSize = this._currentMax.subtract(this._currentMin);
            // Also add a % margin
            this._backPlate.scaling.x = extendSize.x + this._cellWidth * this.backPlateMargin;
            this._backPlate.scaling.y = extendSize.y + this._cellHeight * this.backPlateMargin;
            this._backPlate.scaling.z = 0.001;
            for (var i = 0; i < this._children.length; i++) {
                this._children[i].position.subtractInPlace(this._currentMin).subtractInPlace(extendSize.scale(0.5));
                this._children[i].position.z -= 0.01;
            }
        }
        this._currentMin = null;
        this._currentMax = null;
    };
    /**
     * Adds a button to the menu.
     * Please note that the back material of the button will be set to transparent as it is attached to the menu.
     *
     * @param button Button to add
     * @returns This menu
     */
    TouchHolographicMenu.prototype.addButton = function (button) {
        // Block updating the layout until the button is resized (which has to happen after node creation)
        var wasLayoutBlocked = this.blockLayout;
        if (!wasLayoutBlocked) {
            this.blockLayout = true;
        }
        _super.prototype.addControl.call(this, button);
        button.isBackplateVisible = false;
        button.scaling.scaleInPlace(TouchHolographicMenu.MENU_BUTTON_SCALE);
        // Unblocking the layout triggers the pending layout update that uses the size of the buttons to determine the size of the backing mesh
        if (!wasLayoutBlocked) {
            this.blockLayout = false;
        }
        return this;
    };
    /**
     * This method should not be used directly. It is inherited from `Container3D`.
     * Please use `addButton` instead.
     * @param _control
     * @returns
     */
    TouchHolographicMenu.prototype.addControl = function (_control) {
        core_Meshes_mesh__WEBPACK_IMPORTED_MODULE_2__.Logger.Warn("TouchHolographicMenu can only contain buttons. Please use the method `addButton` instead.");
        return this;
    };
    /**
     * Disposes the menu
     */
    TouchHolographicMenu.prototype.dispose = function () {
        _super.prototype.dispose.call(this);
        this._host.onPickedPointChangedObservable.remove(this._pickedPointObserver);
    };
    /**
     * Scale for the buttons added to the menu
     */
    // eslint-disable-next-line @typescript-eslint/naming-convention
    TouchHolographicMenu.MENU_BUTTON_SCALE = 1;
    return TouchHolographicMenu;
}(_volumeBasedPanel__WEBPACK_IMPORTED_MODULE_1__.VolumeBasedPanel));



/***/ }),

/***/ "../../../lts/gui/dist/3D/controls/touchMeshButton3D.js":
/*!**************************************************************!*\
  !*** ../../../lts/gui/dist/3D/controls/touchMeshButton3D.js ***!
  \**************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "TouchMeshButton3D": () => (/* binding */ TouchMeshButton3D)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var _touchButton3D__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./touchButton3D */ "../../../lts/gui/dist/3D/controls/touchButton3D.js");


/**
 * Class used to create an interactable object. It's a touchable 3D button using a mesh coming from the current scene
 * @since 5.0.0
 */
var TouchMeshButton3D = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(TouchMeshButton3D, _super);
    /**
     * Creates a new 3D button based on a mesh
     * @param mesh mesh to become a 3D button. By default this is also the mesh for near interaction collision checking
     * @param name defines the control name
     */
    function TouchMeshButton3D(mesh, name) {
        var _this = _super.call(this, name, mesh) || this;
        _this._currentMesh = mesh;
        /**
         * Provides a default behavior on hover/out & up/down
         * Override those function to create your own desired behavior specific to your mesh
         */
        _this.pointerEnterAnimation = function () {
            if (!_this.mesh) {
                return;
            }
            _this.mesh.scaling.scaleInPlace(1.1);
        };
        _this.pointerOutAnimation = function () {
            if (!_this.mesh) {
                return;
            }
            _this.mesh.scaling.scaleInPlace(1.0 / 1.1);
        };
        _this.pointerDownAnimation = function () {
            if (!_this.mesh) {
                return;
            }
            _this.mesh.scaling.scaleInPlace(0.95);
        };
        _this.pointerUpAnimation = function () {
            if (!_this.mesh) {
                return;
            }
            _this.mesh.scaling.scaleInPlace(1.0 / 0.95);
        };
        return _this;
    }
    TouchMeshButton3D.prototype._getTypeName = function () {
        return "TouchMeshButton3D";
    };
    // Mesh association
    TouchMeshButton3D.prototype._createNode = function () {
        var _this = this;
        this._currentMesh.getChildMeshes().forEach(function (mesh) {
            _this._injectGUI3DReservedDataStore(mesh).control = _this;
        });
        return this._currentMesh;
    };
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    TouchMeshButton3D.prototype._affectMaterial = function (mesh) { };
    return TouchMeshButton3D;
}(_touchButton3D__WEBPACK_IMPORTED_MODULE_1__.TouchButton3D));



/***/ }),

/***/ "../../../lts/gui/dist/3D/controls/volumeBasedPanel.js":
/*!*************************************************************!*\
  !*** ../../../lts/gui/dist/3D/controls/volumeBasedPanel.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "VolumeBasedPanel": () => (/* binding */ VolumeBasedPanel)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Maths/math.vector */ "core/Misc/observable");
/* harmony import */ var core_Misc_tools__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _container3D__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./container3D */ "../../../lts/gui/dist/3D/controls/container3D.js");




/**
 * Abstract class used to create a container panel deployed on the surface of a volume
 */
var VolumeBasedPanel = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(VolumeBasedPanel, _super);
    /**
     * Creates new VolumeBasedPanel
     * @param name
     */
    function VolumeBasedPanel(name) {
        var _this = _super.call(this, name) || this;
        _this._columns = 10;
        _this._rows = 0;
        _this._rowThenColum = true;
        _this._orientation = _container3D__WEBPACK_IMPORTED_MODULE_2__.Container3D.FACEORIGIN_ORIENTATION;
        /**
         * Gets or sets the distance between elements
         */
        _this.margin = 0;
        return _this;
    }
    Object.defineProperty(VolumeBasedPanel.prototype, "orientation", {
        /**
         * Gets or sets the orientation to apply to all controls (BABYLON.Container3D.FaceOriginReversedOrientation by default)
         * | Value | Type                                | Description |
         * | ----- | ----------------------------------- | ----------- |
         * | 0     | UNSET_ORIENTATION                   |  Control rotation will remain unchanged |
         * | 1     | FACEORIGIN_ORIENTATION              |  Control will rotate to make it look at sphere central axis |
         * | 2     | FACEORIGINREVERSED_ORIENTATION      |  Control will rotate to make it look back at sphere central axis |
         * | 3     | FACEFORWARD_ORIENTATION             |  Control will rotate to look at z axis (0, 0, 1) |
         * | 4     | FACEFORWARDREVERSED_ORIENTATION     |  Control will rotate to look at negative z axis (0, 0, -1) |
         */
        get: function () {
            return this._orientation;
        },
        set: function (value) {
            var _this = this;
            if (this._orientation === value) {
                return;
            }
            this._orientation = value;
            core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.Tools.SetImmediate(function () {
                _this._arrangeChildren();
            });
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(VolumeBasedPanel.prototype, "columns", {
        /**
         * Gets or sets the number of columns requested (10 by default).
         * The panel will automatically compute the number of rows based on number of child controls.
         */
        get: function () {
            return this._columns;
        },
        set: function (value) {
            var _this = this;
            if (this._columns === value) {
                return;
            }
            this._columns = value;
            this._rowThenColum = true;
            core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.Tools.SetImmediate(function () {
                _this._arrangeChildren();
            });
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(VolumeBasedPanel.prototype, "rows", {
        /**
         * Gets or sets a the number of rows requested.
         * The panel will automatically compute the number of columns based on number of child controls.
         */
        get: function () {
            return this._rows;
        },
        set: function (value) {
            var _this = this;
            if (this._rows === value) {
                return;
            }
            this._rows = value;
            this._rowThenColum = false;
            core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.Tools.SetImmediate(function () {
                _this._arrangeChildren();
            });
        },
        enumerable: false,
        configurable: true
    });
    VolumeBasedPanel.prototype._arrangeChildren = function () {
        this._cellWidth = 0;
        this._cellHeight = 0;
        var rows = 0;
        var columns = 0;
        var controlCount = 0;
        var currentInverseWorld = core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.Matrix.Invert(this.node.computeWorldMatrix(true));
        // Measure
        for (var _i = 0, _a = this._children; _i < _a.length; _i++) {
            var child = _a[_i];
            if (!child.mesh) {
                continue;
            }
            controlCount++;
            child.mesh.computeWorldMatrix(true);
            //   child.mesh.getWorldMatrix().multiplyToRef(currentInverseWorld, Tmp.Matrix[0]);
            var boundingBox = child.mesh.getHierarchyBoundingVectors();
            var extendSize = core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.TmpVectors.Vector3[0];
            var diff = core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.TmpVectors.Vector3[1];
            boundingBox.max.subtractToRef(boundingBox.min, diff);
            diff.scaleInPlace(0.5);
            core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.Vector3.TransformNormalToRef(diff, currentInverseWorld, extendSize);
            this._cellWidth = Math.max(this._cellWidth, extendSize.x * 2);
            this._cellHeight = Math.max(this._cellHeight, extendSize.y * 2);
        }
        this._cellWidth += this.margin * 2;
        this._cellHeight += this.margin * 2;
        // Arrange
        if (this._rowThenColum) {
            columns = this._columns;
            rows = Math.ceil(controlCount / this._columns);
        }
        else {
            rows = this._rows;
            columns = Math.ceil(controlCount / this._rows);
        }
        var startOffsetX = columns * 0.5 * this._cellWidth;
        var startOffsetY = rows * 0.5 * this._cellHeight;
        var nodeGrid = [];
        var cellCounter = 0;
        if (this._rowThenColum) {
            for (var r = 0; r < rows; r++) {
                for (var c = 0; c < columns; c++) {
                    nodeGrid.push(new core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.Vector3(c * this._cellWidth - startOffsetX + this._cellWidth / 2, r * this._cellHeight - startOffsetY + this._cellHeight / 2, 0));
                    cellCounter++;
                    if (cellCounter > controlCount) {
                        break;
                    }
                }
            }
        }
        else {
            for (var c = 0; c < columns; c++) {
                for (var r = 0; r < rows; r++) {
                    nodeGrid.push(new core_Misc_tools__WEBPACK_IMPORTED_MODULE_1__.Vector3(c * this._cellWidth - startOffsetX + this._cellWidth / 2, r * this._cellHeight - startOffsetY + this._cellHeight / 2, 0));
                    cellCounter++;
                    if (cellCounter > controlCount) {
                        break;
                    }
                }
            }
        }
        cellCounter = 0;
        for (var _b = 0, _c = this._children; _b < _c.length; _b++) {
            var child = _c[_b];
            if (!child.mesh) {
                continue;
            }
            this._mapGridNode(child, nodeGrid[cellCounter]);
            cellCounter++;
        }
        this._finalProcessing();
    };
    /** Child classes can implement this function to provide additional processing */
    VolumeBasedPanel.prototype._finalProcessing = function () { };
    return VolumeBasedPanel;
}(_container3D__WEBPACK_IMPORTED_MODULE_2__.Container3D));



/***/ }),

/***/ "../../../lts/gui/dist/3D/gizmos/gizmoHandle.js":
/*!******************************************************!*\
  !*** ../../../lts/gui/dist/3D/gizmos/gizmoHandle.js ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "CornerHandle": () => (/* binding */ CornerHandle),
/* harmony export */   "GizmoHandle": () => (/* binding */ GizmoHandle),
/* harmony export */   "HandleState": () => (/* binding */ HandleState),
/* harmony export */   "SideHandle": () => (/* binding */ SideHandle)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Meshes_Builders_boxBuilder__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Behaviors/Meshes/baseSixDofDragBehavior */ "core/Misc/observable");
/* harmony import */ var core_Meshes_Builders_boxBuilder__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Meshes_Builders_boxBuilder__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _materials_handle_handleMaterial__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../materials/handle/handleMaterial */ "../../../lts/gui/dist/3D/materials/handle/handleMaterial.js");






/**
 * State of the handle regarding user interaction
 */
var HandleState;
(function (HandleState) {
    /**
     * Handle is idle
     */
    HandleState[HandleState["IDLE"] = 0] = "IDLE";
    /**
     * Handle is hovered
     */
    HandleState[HandleState["HOVER"] = 1] = "HOVER";
    /**
     * Handle is dragged
     */
    HandleState[HandleState["DRAG"] = 2] = "DRAG";
})(HandleState || (HandleState = {}));
/**
 * Base class for SlateGizmo handles
 */
var GizmoHandle = /** @class */ (function () {
    /**
     * Creates a handle for a SlateGizmo
     * @param gizmo associated SlateGizmo
     * @param scene scene
     */
    function GizmoHandle(gizmo, scene) {
        this._state = HandleState.IDLE;
        this._materials = [];
        this._scene = scene;
        this._gizmo = gizmo;
        this.node = this.createNode();
        this.node.reservedDataStore = {
            handle: this,
        };
    }
    Object.defineProperty(GizmoHandle.prototype, "state", {
        /**
         * The current state of the handle
         */
        get: function () {
            return this._state;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(GizmoHandle.prototype, "gizmo", {
        /**
         * Returns the gizmo carrying this handle
         */
        get: function () {
            return this._gizmo;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(GizmoHandle.prototype, "hover", {
        /**
         * Sets hover state
         */
        set: function (value) {
            if (value) {
                this._state |= HandleState.HOVER;
            }
            else {
                this._state &= ~HandleState.HOVER;
            }
            this._updateMaterial();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(GizmoHandle.prototype, "drag", {
        /**
         * Sets drag state
         */
        set: function (value) {
            if (value) {
                this._state |= HandleState.DRAG;
            }
            else {
                this._state &= ~HandleState.DRAG;
            }
            this._updateMaterial();
        },
        enumerable: false,
        configurable: true
    });
    GizmoHandle.prototype._createMaterial = function (positionOffset) {
        var mat = new _materials_handle_handleMaterial__WEBPACK_IMPORTED_MODULE_2__.HandleMaterial("handle", this._scene);
        if (positionOffset) {
            mat._positionOffset = positionOffset;
        }
        return mat;
    };
    GizmoHandle.prototype._updateMaterial = function () {
        var state = this._state;
        for (var _i = 0, _a = this._materials; _i < _a.length; _i++) {
            var mat = _a[_i];
            mat.hover = false;
            mat.drag = false;
        }
        if (state & HandleState.DRAG) {
            for (var _b = 0, _c = this._materials; _b < _c.length; _b++) {
                var mat = _c[_b];
                mat.drag = true;
            }
        }
        else if (state & HandleState.HOVER) {
            for (var _d = 0, _e = this._materials; _d < _e.length; _d++) {
                var mat = _e[_d];
                mat.hover = true;
            }
        }
    };
    /**
     * Binds callbacks from dragging interaction
     * @param dragStartFn Function to call on drag start
     * @param dragFn Function to call on drag
     * @param dragEndFn Function to call on drag end
     */
    GizmoHandle.prototype.setDragBehavior = function (dragStartFn, dragFn, dragEndFn) {
        var dragBehavior = new core_Meshes_Builders_boxBuilder__WEBPACK_IMPORTED_MODULE_1__.BaseSixDofDragBehavior();
        this._dragBehavior = dragBehavior;
        this._dragStartObserver = dragBehavior.onDragStartObservable.add(dragStartFn);
        this._draggingObserver = dragBehavior.onDragObservable.add(dragFn);
        this._dragEndObserver = dragBehavior.onDragEndObservable.add(dragEndFn);
        this._dragBehavior.attach(this.node);
    };
    /**
     * Disposes the handle
     */
    GizmoHandle.prototype.dispose = function () {
        this._dragBehavior.onDragStartObservable.remove(this._dragStartObserver);
        this._dragBehavior.onDragObservable.remove(this._draggingObserver);
        this._dragBehavior.onDragEndObservable.remove(this._dragEndObserver);
        this._dragBehavior.detach();
        for (var _i = 0, _a = this._materials; _i < _a.length; _i++) {
            var material = _a[_i];
            material.dispose();
        }
        this.node.dispose();
    };
    return GizmoHandle;
}());

/**
 * Side handle class that rotates the slate
 */
var SideHandle = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(SideHandle, _super);
    function SideHandle() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    /**
     * Creates the meshes and parent node of the handle
     * @returns created node
     */
    SideHandle.prototype.createNode = function () {
        // Create a simple vertical rectangle
        var verticalBox = (0,core_Meshes_Builders_boxBuilder__WEBPACK_IMPORTED_MODULE_1__.CreateBox)("sideVert", { width: 1, height: 10, depth: 0.1 }, this._scene);
        var sideNode = new core_Meshes_Builders_boxBuilder__WEBPACK_IMPORTED_MODULE_1__.TransformNode("side", this._scene);
        verticalBox.parent = sideNode;
        var mat = this._createMaterial();
        verticalBox.material = mat;
        verticalBox.isNearGrabbable = true;
        this._materials.push(mat);
        return sideNode;
    };
    return SideHandle;
}(GizmoHandle));

/**
 * Corner handle that resizes the slate
 */
var CornerHandle = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(CornerHandle, _super);
    function CornerHandle() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    /**
     * Creates the meshes and parent node of the handle
     * @returns created node
     */
    CornerHandle.prototype.createNode = function () {
        // Create 2 boxes making a bottom left corner
        var horizontalBox = (0,core_Meshes_Builders_boxBuilder__WEBPACK_IMPORTED_MODULE_1__.CreateBox)("angleHor", { width: 3, height: 1, depth: 0.1 }, this._scene);
        var verticalBox = (0,core_Meshes_Builders_boxBuilder__WEBPACK_IMPORTED_MODULE_1__.CreateBox)("angleVert", { width: 1, height: 3, depth: 0.1 }, this._scene);
        var angleNode = new core_Meshes_Builders_boxBuilder__WEBPACK_IMPORTED_MODULE_1__.TransformNode("angle", this._scene);
        horizontalBox.parent = angleNode;
        verticalBox.parent = angleNode;
        horizontalBox.material = this._createMaterial(new core_Meshes_Builders_boxBuilder__WEBPACK_IMPORTED_MODULE_1__.Vector3(1, 0, 0));
        verticalBox.material = this._createMaterial(new core_Meshes_Builders_boxBuilder__WEBPACK_IMPORTED_MODULE_1__.Vector3(0, 1, 0));
        verticalBox.isNearGrabbable = true;
        horizontalBox.isNearGrabbable = true;
        this._materials.push(horizontalBox.material);
        this._materials.push(verticalBox.material);
        return angleNode;
    };
    return CornerHandle;
}(GizmoHandle));



/***/ }),

/***/ "../../../lts/gui/dist/3D/gizmos/index.js":
/*!************************************************!*\
  !*** ../../../lts/gui/dist/3D/gizmos/index.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "CornerHandle": () => (/* reexport safe */ _gizmoHandle__WEBPACK_IMPORTED_MODULE_1__.CornerHandle),
/* harmony export */   "GizmoHandle": () => (/* reexport safe */ _gizmoHandle__WEBPACK_IMPORTED_MODULE_1__.GizmoHandle),
/* harmony export */   "HandleState": () => (/* reexport safe */ _gizmoHandle__WEBPACK_IMPORTED_MODULE_1__.HandleState),
/* harmony export */   "SideHandle": () => (/* reexport safe */ _gizmoHandle__WEBPACK_IMPORTED_MODULE_1__.SideHandle),
/* harmony export */   "SlateGizmo": () => (/* reexport safe */ _slateGizmo__WEBPACK_IMPORTED_MODULE_0__.SlateGizmo)
/* harmony export */ });
/* harmony import */ var _slateGizmo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./slateGizmo */ "../../../lts/gui/dist/3D/gizmos/slateGizmo.js");
/* harmony import */ var _gizmoHandle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./gizmoHandle */ "../../../lts/gui/dist/3D/gizmos/gizmoHandle.js");




/***/ }),

/***/ "../../../lts/gui/dist/3D/gizmos/slateGizmo.js":
/*!*****************************************************!*\
  !*** ../../../lts/gui/dist/3D/gizmos/slateGizmo.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "SlateGizmo": () => (/* binding */ SlateGizmo)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Misc/pivotTools */ "core/Misc/observable");
/* harmony import */ var core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _gizmoHandle__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./gizmoHandle */ "../../../lts/gui/dist/3D/gizmos/gizmoHandle.js");







/**
 * Gizmo to resize 2D slates
 */
var SlateGizmo = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(SlateGizmo, _super);
    function SlateGizmo(utilityLayer) {
        var _this = _super.call(this, utilityLayer) || this;
        _this._boundingDimensions = new core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Vector3(0, 0, 0);
        _this._renderObserver = null;
        _this._tmpQuaternion = new core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Quaternion();
        _this._tmpVector = new core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Vector3(0, 0, 0);
        // Ordered bl, br, tr, tl
        _this._corners = [];
        // Ordered left, bottom, right, top
        _this._sides = [];
        _this._boundingBoxGizmo = {
            min: new core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Vector3(),
            max: new core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Vector3(),
        };
        /**
         * Value we use to offset handles from mesh
         */
        _this._margin = 0.35;
        _this._handleSize = 0.075;
        _this._attachedSlate = null;
        _this._existingSlateScale = new core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Vector3();
        /**
         * If set, the handles will increase in size based on the distance away from the camera to have a consistent screen size (Default: true)
         */
        _this.fixedScreenSize = false;
        /**
         * The distance away from the object which the draggable meshes should appear world sized when fixedScreenSize is set to true (default: 10)
         */
        _this.fixedScreenSizeDistanceFactor = 10;
        _this._createNode();
        _this.updateScale = false;
        _this._renderObserver = _this.gizmoLayer.originalScene.onBeforeRenderObservable.add(function () {
            // Only update the bounding box if scaling has changed
            if (_this.attachedMesh && !_this._existingSlateScale.equals(_this.attachedMesh.scaling)) {
                _this.updateBoundingBox();
            }
        });
        return _this;
    }
    Object.defineProperty(SlateGizmo.prototype, "attachedSlate", {
        get: function () {
            return this._attachedSlate;
        },
        /**
         * The slate attached to this gizmo
         */
        set: function (control) {
            var _this = this;
            if (control) {
                this.attachedMesh = control.mesh;
                this.updateBoundingBox();
                this._pickedPointObserver = control._host.onPickingObservable.add(function (pickedMesh) {
                    if (_this._handleHovered && (!pickedMesh || pickedMesh.parent !== _this._handleHovered.node)) {
                        _this._handleHovered.hover = false;
                        _this._handleHovered = null;
                    }
                    if (pickedMesh && pickedMesh.parent && pickedMesh.parent.reservedDataStore && pickedMesh.parent.reservedDataStore.handle) {
                        var handle = pickedMesh.parent.reservedDataStore.handle;
                        if (handle.gizmo === _this) {
                            _this._handleHovered = handle;
                            _this._handleHovered.hover = true;
                        }
                    }
                });
            }
            else if (this._attachedSlate) {
                this._attachedSlate._host.onPickingObservable.remove(this._pickedPointObserver);
            }
            this._attachedSlate = control;
        },
        enumerable: false,
        configurable: true
    });
    SlateGizmo.prototype._createNode = function () {
        var _this = this;
        this._handlesParent = new core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.TransformNode("handlesParent", this.gizmoLayer.utilityLayerScene);
        this._handlesParent.rotationQuaternion = core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Quaternion.Identity();
        var masksCorners = [
            {
                dimensions: new core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Vector3(-1, -1, 0),
                origin: new core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Vector3(1, 0, 0),
            },
            {
                dimensions: new core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Vector3(1, -1, 0),
                origin: new core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Vector3(0, 0, 0),
            },
            {
                dimensions: new core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Vector3(1, 1, 0),
                origin: new core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Vector3(0, 1, 0),
            },
            {
                dimensions: new core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Vector3(-1, 1, 0),
                origin: new core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Vector3(1, 1, 0),
            },
        ];
        for (var i = 0; i < 4; i++) {
            var corner = new _gizmoHandle__WEBPACK_IMPORTED_MODULE_2__.CornerHandle(this, this.gizmoLayer.utilityLayerScene);
            this._corners.push(corner);
            corner.node.rotation.z = (Math.PI / 2) * i;
            corner.node.parent = this._handlesParent;
            this._assignDragBehaviorCorners(corner, function (originStart, dimensionsStart, offset, masks) { return _this._moveHandle(originStart, dimensionsStart, offset, masks, true); }, masksCorners[i]);
        }
        for (var i = 0; i < 4; i++) {
            var side = new _gizmoHandle__WEBPACK_IMPORTED_MODULE_2__.SideHandle(this, this.gizmoLayer.utilityLayerScene);
            this._sides.push(side);
            side.node.rotation.z = (Math.PI / 2) * i;
            side.node.parent = this._handlesParent;
            this._assignDragBehaviorSides(side, i % 2 === 0 ? new core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Vector3(0, 1, 0) : new core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Vector3(1, 0, 0));
        }
        this._handlesParent.parent = this._rootMesh;
    };
    SlateGizmo.prototype._keepAspectRatio = function (vector, aspectRatio, invertDiagonal) {
        if (invertDiagonal === void 0) { invertDiagonal = false; }
        var axis = core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.TmpVectors.Vector3[0];
        axis.copyFromFloats(aspectRatio, 1, 0).normalize();
        if (invertDiagonal) {
            axis.y *= -1;
        }
        var dot = core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Vector3.Dot(vector, axis);
        vector.copyFrom(axis).scaleInPlace(dot);
    };
    SlateGizmo.prototype._clampDimensions = function (vector, dimensions, mask, keepAspectRatio) {
        if (keepAspectRatio === void 0) { keepAspectRatio = false; }
        var impact = core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.TmpVectors.Vector3[0];
        impact.copyFrom(vector).multiplyInPlace(mask);
        var clampedDimensions = core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.TmpVectors.Vector3[1];
        clampedDimensions.copyFromFloats(Math.max(this._attachedSlate.minDimensions.x, impact.x + dimensions.x), Math.max(this._attachedSlate.minDimensions.y, impact.y + dimensions.y), 0);
        if (keepAspectRatio) {
            // Extra logic to ensure the ratio is maintained when the vector has been clamped
            var ratio = dimensions.x / dimensions.y;
            clampedDimensions.x = Math.max(clampedDimensions.x, clampedDimensions.y * ratio);
            clampedDimensions.y = Math.max(clampedDimensions.y, clampedDimensions.x / ratio);
        }
        // Calculating the real impact of vector on clamped dimensions
        impact.copyFrom(clampedDimensions).subtractInPlace(dimensions);
        vector.x = Math.sign(vector.x) * Math.abs(impact.x);
        vector.y = Math.sign(vector.y) * Math.abs(impact.y);
    };
    SlateGizmo.prototype._moveHandle = function (originStart, dimensionsStart, offset, masks, isCorner) {
        if (!this._attachedSlate) {
            return;
        }
        if (isCorner) {
            var aspectRatio = dimensionsStart.x / dimensionsStart.y;
            this._keepAspectRatio(offset, aspectRatio, masks.dimensions.x * masks.dimensions.y < 0);
        }
        this._clampDimensions(offset, dimensionsStart, masks.dimensions, isCorner);
        var offsetOriginMasked = core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.TmpVectors.Vector3[0];
        var offsetDimensionsMasked = core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.TmpVectors.Vector3[1];
        offsetOriginMasked.copyFrom(offset).multiplyInPlace(masks.origin);
        offsetDimensionsMasked.copyFrom(offset).multiplyInPlace(masks.dimensions);
        this._attachedSlate.origin.copyFrom(originStart).addInPlace(offsetOriginMasked);
        this._attachedSlate.dimensions.set(dimensionsStart.x + offsetDimensionsMasked.x, dimensionsStart.y + offsetDimensionsMasked.y);
    };
    SlateGizmo.prototype._assignDragBehaviorCorners = function (handle, moveFn, masks) {
        var _this = this;
        var dimensionsStart = new core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Vector3();
        var originStart = new core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Vector3();
        var dragOrigin = new core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Vector3();
        var toObjectFrame = new core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Matrix();
        var dragPlaneNormal = new core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Vector3();
        var projectToRef = function (position, normal, origin, ref) {
            // Projects on the plane with its normal and origin
            position.subtractToRef(origin, core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.TmpVectors.Vector3[0]);
            var dot = core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Vector3.Dot(core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.TmpVectors.Vector3[0], normal);
            core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.TmpVectors.Vector3[1].copyFrom(normal).scaleInPlace(dot);
            core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.TmpVectors.Vector3[0].subtractInPlace(core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.TmpVectors.Vector3[1]);
            core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.TmpVectors.Vector3[0].addToRef(origin, ref);
        };
        var dragStart = function (event) {
            if (_this.attachedSlate && _this.attachedMesh) {
                dimensionsStart.set(_this.attachedSlate.dimensions.x, _this.attachedSlate.dimensions.y, core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Epsilon);
                originStart.copyFrom(_this.attachedSlate.origin);
                dragOrigin.copyFrom(event.position);
                toObjectFrame.copyFrom(_this.attachedMesh.computeWorldMatrix(true));
                toObjectFrame.invert();
                _this.attachedSlate._followButton.isToggled = false;
                core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Vector3.TransformNormalToRef(core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Vector3.Forward(), _this.attachedMesh.getWorldMatrix(), dragPlaneNormal);
                dragPlaneNormal.normalize();
                if (_this._handleHovered) {
                    _this._handleDragged = _this._handleHovered;
                    _this._handleDragged.drag = true;
                }
            }
        };
        var dragging = function (event) {
            if (_this.attachedSlate && _this.attachedMesh) {
                projectToRef(event.position, dragPlaneNormal, dragOrigin, _this._tmpVector);
                _this._tmpVector.subtractInPlace(dragOrigin);
                core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Vector3.TransformNormalToRef(_this._tmpVector, toObjectFrame, _this._tmpVector);
                moveFn(originStart, dimensionsStart, _this._tmpVector, masks);
                _this.attachedSlate._positionElements();
                _this.updateBoundingBox();
            }
        };
        var dragEnd = function () {
            if (_this.attachedSlate && _this.attachedNode) {
                _this.attachedSlate._updatePivot();
                if (_this._handleDragged) {
                    _this._handleDragged.drag = false;
                    _this._handleDragged = null;
                }
            }
        };
        handle.setDragBehavior(dragStart, dragging, dragEnd);
    };
    SlateGizmo.prototype._assignDragBehaviorSides = function (handle, dragPlaneNormal) {
        var _this = this;
        var quaternionOrigin = new core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Quaternion();
        var dragOrigin = new core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Vector3();
        var directionOrigin = new core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Vector3();
        var worldPivot = new core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Vector3();
        var worldPlaneNormal = new core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Vector3();
        var dragStart = function (event) {
            if (_this.attachedSlate && _this.attachedMesh) {
                quaternionOrigin.copyFrom(_this.attachedMesh.rotationQuaternion);
                dragOrigin.copyFrom(event.position);
                worldPivot.copyFrom(_this.attachedMesh.getAbsolutePivotPoint());
                directionOrigin.copyFrom(dragOrigin).subtractInPlace(worldPivot).normalize();
                _this.attachedSlate._followButton.isToggled = false;
                core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Vector3.TransformNormalToRef(dragPlaneNormal, _this.attachedMesh.getWorldMatrix(), worldPlaneNormal);
                worldPlaneNormal.normalize();
                if (_this._handleHovered) {
                    _this._handleDragged = _this._handleHovered;
                    _this._handleDragged.drag = true;
                }
            }
        };
        var dragging = function (event) {
            if (_this.attachedSlate && _this.attachedMesh) {
                _this._tmpVector.copyFrom(event.position);
                _this._tmpVector.subtractInPlace(worldPivot);
                _this._tmpVector.normalize();
                var angle = -core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Vector3.GetAngleBetweenVectorsOnPlane(_this._tmpVector, directionOrigin, worldPlaneNormal);
                core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Quaternion.RotationAxisToRef(dragPlaneNormal, angle, _this._tmpQuaternion);
                quaternionOrigin.multiplyToRef(_this._tmpQuaternion, _this.attachedMesh.rotationQuaternion);
            }
        };
        var dragEnd = function () {
            if (_this.attachedSlate && _this.attachedNode) {
                _this.attachedSlate._updatePivot();
                if (_this._handleDragged) {
                    _this._handleDragged.drag = false;
                    _this._handleDragged = null;
                }
            }
        };
        handle.setDragBehavior(dragStart, dragging, dragEnd);
    };
    SlateGizmo.prototype._attachedNodeChanged = function (value) {
        if (value) {
            this.updateBoundingBox();
        }
    };
    /**
     * Updates the bounding box information for the gizmo
     */
    SlateGizmo.prototype.updateBoundingBox = function () {
        if (this.attachedMesh) {
            core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.PivotTools._RemoveAndStorePivotPoint(this.attachedMesh);
            // Store original parent
            var originalParent = this.attachedMesh.parent;
            this.attachedMesh.setParent(null);
            this._update();
            // Rotate based on axis
            if (!this.attachedMesh.rotationQuaternion) {
                this.attachedMesh.rotationQuaternion = core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Quaternion.RotationYawPitchRoll(this.attachedMesh.rotation.y, this.attachedMesh.rotation.x, this.attachedMesh.rotation.z);
            }
            // Store original position and reset mesh to origin before computing the bounding box
            this._tmpQuaternion.copyFrom(this.attachedMesh.rotationQuaternion);
            this._tmpVector.copyFrom(this.attachedMesh.position);
            this.attachedMesh.rotationQuaternion.set(0, 0, 0, 1);
            this.attachedMesh.position.set(0, 0, 0);
            // Update bounding dimensions/positions
            var boundingMinMax = this.attachedMesh.getHierarchyBoundingVectors();
            boundingMinMax.max.subtractToRef(boundingMinMax.min, this._boundingDimensions);
            this._boundingBoxGizmo.min = boundingMinMax.min;
            this._boundingBoxGizmo.max = boundingMinMax.max;
            // Update handles of the gizmo
            this._updateHandlesPosition();
            this._updateHandlesScaling();
            // Restore position/rotation values
            this.attachedMesh.rotationQuaternion.copyFrom(this._tmpQuaternion);
            this.attachedMesh.position.copyFrom(this._tmpVector);
            core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.PivotTools._RestorePivotPoint(this.attachedMesh);
            // Restore original parent
            this.attachedMesh.setParent(originalParent);
            this.attachedMesh.computeWorldMatrix(true);
            this._existingSlateScale.copyFrom(this.attachedMesh.scaling);
        }
    };
    SlateGizmo.prototype._updateHandlesPosition = function () {
        var min = this._boundingBoxGizmo.min.clone();
        var max = this._boundingBoxGizmo.max.clone();
        var handleScaling = this._corners[0].node.scaling.length();
        min.x -= this._margin * handleScaling;
        min.y -= this._margin * handleScaling;
        max.x += this._margin * handleScaling;
        max.y += this._margin * handleScaling;
        var center = min.add(max).scaleInPlace(0.5);
        this._corners[0].node.position.copyFromFloats(min.x, min.y, 0);
        this._corners[1].node.position.copyFromFloats(max.x, min.y, 0);
        this._corners[2].node.position.copyFromFloats(max.x, max.y, 0);
        this._corners[3].node.position.copyFromFloats(min.x, max.y, 0);
        this._sides[0].node.position.copyFromFloats(min.x, center.y, 0);
        this._sides[1].node.position.copyFromFloats(center.x, min.y, 0);
        this._sides[2].node.position.copyFromFloats(max.x, center.y, 0);
        this._sides[3].node.position.copyFromFloats(center.x, max.y, 0);
    };
    SlateGizmo.prototype._updateHandlesScaling = function () {
        if (this._attachedSlate && this._attachedSlate.mesh) {
            var scaledWidth = this._attachedSlate.mesh.scaling.x * this._attachedSlate.dimensions.x;
            var scaledHeight = this._attachedSlate.mesh.scaling.y * this._attachedSlate.dimensions.y;
            var scale = Math.min(scaledWidth, scaledHeight) * this._handleSize;
            for (var index = 0; index < this._corners.length; index++) {
                this._corners[index].node.scaling.setAll(scale);
            }
            for (var index = 0; index < this._sides.length; index++) {
                this._sides[index].node.scaling.setAll(scale);
            }
        }
    };
    SlateGizmo.prototype._update = function () {
        _super.prototype._update.call(this);
        if (!this.gizmoLayer.utilityLayerScene.activeCamera) {
            return;
        }
        if (this._attachedSlate && this._attachedSlate.mesh) {
            if (this.fixedScreenSize) {
                this._attachedSlate.mesh.absolutePosition.subtractToRef(this.gizmoLayer.utilityLayerScene.activeCamera.position, this._tmpVector);
                var distanceFromCamera = (this._handleSize * this._tmpVector.length()) / this.fixedScreenSizeDistanceFactor;
                for (var i = 0; i < this._corners.length; i++) {
                    this._corners[i].node.scaling.set(distanceFromCamera, distanceFromCamera, distanceFromCamera);
                }
                for (var i = 0; i < this._sides.length; i++) {
                    this._sides[i].node.scaling.set(distanceFromCamera, distanceFromCamera, distanceFromCamera);
                }
            }
            this._updateHandlesPosition();
        }
    };
    SlateGizmo.prototype.dispose = function () {
        this.gizmoLayer.originalScene.onBeforeRenderObservable.remove(this._renderObserver);
        // Will dispose rootMesh and all descendants
        _super.prototype.dispose.call(this);
        for (var _i = 0, _a = this._corners; _i < _a.length; _i++) {
            var corner = _a[_i];
            corner.dispose();
        }
        for (var _b = 0, _c = this._sides; _b < _c.length; _b++) {
            var side = _c[_b];
            side.dispose();
        }
    };
    return SlateGizmo;
}(core_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__.Gizmo));



/***/ }),

/***/ "../../../lts/gui/dist/3D/gui3DManager.js":
/*!************************************************!*\
  !*** ../../../lts/gui/dist/3D/gui3DManager.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "GUI3DManager": () => (/* binding */ GUI3DManager)
/* harmony export */ });
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Engines/engineStore */ "core/Misc/observable");
/* harmony import */ var core_Misc_observable__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _controls_container3D__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./controls/container3D */ "../../../lts/gui/dist/3D/controls/container3D.js");







/**
 * Class used to manage 3D user interface
 * @see https://doc.babylonjs.com/how_to/gui3d
 */
var GUI3DManager = /** @class */ (function () {
    /**
     * Creates a new GUI3DManager
     * @param scene
     */
    function GUI3DManager(scene) {
        var _this = this;
        this._customControlScaling = 1.0;
        /** @hidden */
        this._lastControlOver = {};
        /** @hidden */
        this._lastControlDown = {};
        /**
         * Observable raised when the point picked by the pointer events changed
         */
        this.onPickedPointChangedObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        /**
         * Observable raised when a picking happens
         */
        this.onPickingObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
        // Shared resources
        /** @hidden */
        this._sharedMaterials = {};
        /** @hidden */
        this._touchSharedMaterials = {};
        this._scene = scene || core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.EngineStore.LastCreatedScene;
        this._sceneDisposeObserver = this._scene.onDisposeObservable.add(function () {
            _this._sceneDisposeObserver = null;
            _this._utilityLayer = null;
            _this.dispose();
        });
        this._utilityLayer = core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.UtilityLayerRenderer._CreateDefaultUtilityLayerFromScene(this._scene);
        this._utilityLayer.onlyCheckPointerDownEvents = false;
        this._utilityLayer.pickUtilitySceneFirst = false;
        this._utilityLayer.mainSceneTrackerPredicate = function (mesh) {
            var _a, _b, _c;
            return mesh && ((_c = (_b = (_a = mesh.reservedDataStore) === null || _a === void 0 ? void 0 : _a.GUI3D) === null || _b === void 0 ? void 0 : _b.control) === null || _c === void 0 ? void 0 : _c._node);
        };
        // Root
        this._rootContainer = new _controls_container3D__WEBPACK_IMPORTED_MODULE_1__.Container3D("RootContainer");
        this._rootContainer._host = this;
        var utilityLayerScene = this._utilityLayer.utilityLayerScene;
        // Events
        this._pointerOutObserver = this._utilityLayer.onPointerOutObservable.add(function (pointerId) {
            _this._handlePointerOut(pointerId, true);
        });
        this._pointerObserver = utilityLayerScene.onPointerObservable.add(function (pi) {
            _this._doPicking(pi);
        });
        // Scene
        this._utilityLayer.utilityLayerScene.autoClear = false;
        this._utilityLayer.utilityLayerScene.autoClearDepthAndStencil = false;
        new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.HemisphericLight("hemi", core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Vector3.Up(), this._utilityLayer.utilityLayerScene);
    }
    Object.defineProperty(GUI3DManager.prototype, "scene", {
        /** Gets the hosting scene */
        get: function () {
            return this._scene;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(GUI3DManager.prototype, "utilityLayer", {
        /** Gets associated utility layer */
        get: function () {
            return this._utilityLayer;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(GUI3DManager.prototype, "controlScaling", {
        /** Gets the scaling for all UI elements owned by this manager */
        get: function () {
            return this._customControlScaling;
        },
        /** Sets the scaling adjustment for all UI elements owned by this manager */
        set: function (newScale) {
            if (this._customControlScaling !== newScale && newScale > 0) {
                var scaleRatio_1 = newScale / this._customControlScaling;
                this._customControlScaling = newScale;
                this._rootContainer.children.forEach(function (control) {
                    control.scaling.scaleInPlace(scaleRatio_1);
                    if (newScale !== 1) {
                        control._isScaledByManager = true;
                    }
                });
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(GUI3DManager.prototype, "useRealisticScaling", {
        /** Gets if controls attached to this manager are realistically sized, based on the fact that 1 unit length is 1 meter */
        get: function () {
            return this.controlScaling === GUI3DManager.MRTK_REALISTIC_SCALING;
        },
        /** Sets if controls attached to this manager are realistically sized, based on the fact that 1 unit length is 1 meter */
        set: function (newValue) {
            this.controlScaling = newValue ? GUI3DManager.MRTK_REALISTIC_SCALING : 1;
        },
        enumerable: false,
        configurable: true
    });
    GUI3DManager.prototype._handlePointerOut = function (pointerId, isPointerUp) {
        var previousControlOver = this._lastControlOver[pointerId];
        if (previousControlOver) {
            previousControlOver._onPointerOut(previousControlOver);
            delete this._lastControlOver[pointerId];
        }
        if (isPointerUp) {
            if (this._lastControlDown[pointerId]) {
                this._lastControlDown[pointerId].forcePointerUp();
                delete this._lastControlDown[pointerId];
            }
        }
        this.onPickedPointChangedObservable.notifyObservers(null);
    };
    GUI3DManager.prototype._doPicking = function (pi) {
        var _a, _b, _c;
        if (!this._utilityLayer || !this._utilityLayer.shouldRender || !this._utilityLayer.utilityLayerScene.activeCamera) {
            return false;
        }
        var pointerEvent = pi.event;
        var pointerId = pointerEvent.pointerId || 0;
        var buttonIndex = pointerEvent.button;
        var pickingInfo = pi.pickInfo;
        if (pickingInfo) {
            this.onPickingObservable.notifyObservers(pickingInfo.pickedMesh);
        }
        if (!pickingInfo || !pickingInfo.hit) {
            this._handlePointerOut(pointerId, pi.type === core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.PointerEventTypes.POINTERUP);
            return false;
        }
        if (pickingInfo.pickedPoint) {
            this.onPickedPointChangedObservable.notifyObservers(pickingInfo.pickedPoint);
        }
        var control = (_b = (_a = pickingInfo.pickedMesh.reservedDataStore) === null || _a === void 0 ? void 0 : _a.GUI3D) === null || _b === void 0 ? void 0 : _b.control;
        if (!!control && !control._processObservables(pi.type, pickingInfo.pickedPoint, ((_c = pickingInfo.originMesh) === null || _c === void 0 ? void 0 : _c.position) || null, pointerId, buttonIndex)) {
            if (pi.type === core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.PointerEventTypes.POINTERMOVE) {
                if (this._lastControlOver[pointerId]) {
                    this._lastControlOver[pointerId]._onPointerOut(this._lastControlOver[pointerId]);
                }
                delete this._lastControlOver[pointerId];
            }
        }
        if (pi.type === core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.PointerEventTypes.POINTERUP) {
            if (this._lastControlDown[pointerEvent.pointerId]) {
                this._lastControlDown[pointerEvent.pointerId].forcePointerUp();
                delete this._lastControlDown[pointerEvent.pointerId];
            }
            if (pointerEvent.pointerType === "touch") {
                this._handlePointerOut(pointerId, false);
            }
        }
        return true;
    };
    Object.defineProperty(GUI3DManager.prototype, "rootContainer", {
        /**
         * Gets the root container
         */
        get: function () {
            return this._rootContainer;
        },
        enumerable: false,
        configurable: true
    });
    /**
     * Gets a boolean indicating if the given control is in the root child list
     * @param control defines the control to check
     * @returns true if the control is in the root child list
     */
    GUI3DManager.prototype.containsControl = function (control) {
        return this._rootContainer.containsControl(control);
    };
    /**
     * Adds a control to the root child list
     * @param control defines the control to add
     * @returns the current manager
     */
    GUI3DManager.prototype.addControl = function (control) {
        this._rootContainer.addControl(control);
        if (this._customControlScaling !== 1) {
            control.scaling.scaleInPlace(this._customControlScaling);
            control._isScaledByManager = true;
        }
        return this;
    };
    /**
     * Removes a control from the root child list
     * @param control defines the control to remove
     * @returns the current container
     */
    GUI3DManager.prototype.removeControl = function (control) {
        this._rootContainer.removeControl(control);
        if (control._isScaledByManager) {
            control.scaling.scaleInPlace(1 / this._customControlScaling);
            control._isScaledByManager = false;
        }
        return this;
    };
    /**
     * Releases all associated resources
     */
    GUI3DManager.prototype.dispose = function () {
        this._rootContainer.dispose();
        for (var materialName in this._sharedMaterials) {
            if (!Object.prototype.hasOwnProperty.call(this._sharedMaterials, materialName)) {
                continue;
            }
            this._sharedMaterials[materialName].dispose();
        }
        this._sharedMaterials = {};
        for (var materialName in this._touchSharedMaterials) {
            if (!Object.prototype.hasOwnProperty.call(this._touchSharedMaterials, materialName)) {
                continue;
            }
            this._touchSharedMaterials[materialName].dispose();
        }
        this._touchSharedMaterials = {};
        if (this._pointerOutObserver && this._utilityLayer) {
            this._utilityLayer.onPointerOutObservable.remove(this._pointerOutObserver);
            this._pointerOutObserver = null;
        }
        this.onPickedPointChangedObservable.clear();
        this.onPickingObservable.clear();
        var utilityLayerScene = this._utilityLayer ? this._utilityLayer.utilityLayerScene : null;
        if (utilityLayerScene) {
            if (this._pointerObserver) {
                utilityLayerScene.onPointerObservable.remove(this._pointerObserver);
                this._pointerObserver = null;
            }
        }
        if (this._scene) {
            if (this._sceneDisposeObserver) {
                this._scene.onDisposeObservable.remove(this._sceneDisposeObserver);
                this._sceneDisposeObserver = null;
            }
        }
        if (this._utilityLayer) {
            this._utilityLayer.dispose();
        }
    };
    GUI3DManager.MRTK_REALISTIC_SCALING = 0.032;
    return GUI3DManager;
}());



/***/ }),

/***/ "../../../lts/gui/dist/3D/index.js":
/*!*****************************************!*\
  !*** ../../../lts/gui/dist/3D/index.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "AbstractButton3D": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.AbstractButton3D),
/* harmony export */   "Button3D": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.Button3D),
/* harmony export */   "Container3D": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.Container3D),
/* harmony export */   "Control3D": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.Control3D),
/* harmony export */   "CornerHandle": () => (/* reexport safe */ _gizmos_index__WEBPACK_IMPORTED_MODULE_2__.CornerHandle),
/* harmony export */   "CylinderPanel": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.CylinderPanel),
/* harmony export */   "FluentBackplateMaterial": () => (/* reexport safe */ _materials_index__WEBPACK_IMPORTED_MODULE_1__.FluentBackplateMaterial),
/* harmony export */   "FluentButtonMaterial": () => (/* reexport safe */ _materials_index__WEBPACK_IMPORTED_MODULE_1__.FluentButtonMaterial),
/* harmony export */   "FluentMaterial": () => (/* reexport safe */ _materials_index__WEBPACK_IMPORTED_MODULE_1__.FluentMaterial),
/* harmony export */   "FluentMaterialDefines": () => (/* reexport safe */ _materials_index__WEBPACK_IMPORTED_MODULE_1__.FluentMaterialDefines),
/* harmony export */   "GUI3DManager": () => (/* reexport safe */ _gui3DManager__WEBPACK_IMPORTED_MODULE_3__.GUI3DManager),
/* harmony export */   "GizmoHandle": () => (/* reexport safe */ _gizmos_index__WEBPACK_IMPORTED_MODULE_2__.GizmoHandle),
/* harmony export */   "HandMenu": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.HandMenu),
/* harmony export */   "HandleMaterial": () => (/* reexport safe */ _materials_index__WEBPACK_IMPORTED_MODULE_1__.HandleMaterial),
/* harmony export */   "HandleState": () => (/* reexport safe */ _gizmos_index__WEBPACK_IMPORTED_MODULE_2__.HandleState),
/* harmony export */   "HolographicBackplate": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.HolographicBackplate),
/* harmony export */   "HolographicButton": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.HolographicButton),
/* harmony export */   "HolographicSlate": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.HolographicSlate),
/* harmony export */   "MRDLBackplateMaterial": () => (/* reexport safe */ _materials_index__WEBPACK_IMPORTED_MODULE_1__.MRDLBackplateMaterial),
/* harmony export */   "MRDLSliderBarMaterial": () => (/* reexport safe */ _materials_index__WEBPACK_IMPORTED_MODULE_1__.MRDLSliderBarMaterial),
/* harmony export */   "MRDLSliderThumbMaterial": () => (/* reexport safe */ _materials_index__WEBPACK_IMPORTED_MODULE_1__.MRDLSliderThumbMaterial),
/* harmony export */   "MeshButton3D": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.MeshButton3D),
/* harmony export */   "NearMenu": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.NearMenu),
/* harmony export */   "PlanePanel": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.PlanePanel),
/* harmony export */   "ScatterPanel": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.ScatterPanel),
/* harmony export */   "SideHandle": () => (/* reexport safe */ _gizmos_index__WEBPACK_IMPORTED_MODULE_2__.SideHandle),
/* harmony export */   "SlateGizmo": () => (/* reexport safe */ _gizmos_index__WEBPACK_IMPORTED_MODULE_2__.SlateGizmo),
/* harmony export */   "Slider3D": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.Slider3D),
/* harmony export */   "SpherePanel": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.SpherePanel),
/* harmony export */   "StackPanel3D": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.StackPanel3D),
/* harmony export */   "TouchButton3D": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.TouchButton3D),
/* harmony export */   "TouchHolographicButton": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.TouchHolographicButton),
/* harmony export */   "TouchHolographicMenu": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.TouchHolographicMenu),
/* harmony export */   "TouchMeshButton3D": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.TouchMeshButton3D),
/* harmony export */   "Vector3WithInfo": () => (/* reexport safe */ _vector3WithInfo__WEBPACK_IMPORTED_MODULE_4__.Vector3WithInfo),
/* harmony export */   "VolumeBasedPanel": () => (/* reexport safe */ _controls_index__WEBPACK_IMPORTED_MODULE_0__.VolumeBasedPanel)
/* harmony export */ });
/* harmony import */ var _controls_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./controls/index */ "../../../lts/gui/dist/3D/controls/index.js");
/* harmony import */ var _materials_index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./materials/index */ "../../../lts/gui/dist/3D/materials/index.js");
/* harmony import */ var _gizmos_index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./gizmos/index */ "../../../lts/gui/dist/3D/gizmos/index.js");
/* harmony import */ var _gui3DManager__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./gui3DManager */ "../../../lts/gui/dist/3D/gui3DManager.js");
/* harmony import */ var _vector3WithInfo__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./vector3WithInfo */ "../../../lts/gui/dist/3D/vector3WithInfo.js");
/* eslint-disable import/no-internal-modules */







/***/ }),

/***/ "../../../lts/gui/dist/3D/materials/fluent/fluentMaterial.js":
/*!*******************************************************************!*\
  !*** ../../../lts/gui/dist/3D/materials/fluent/fluentMaterial.js ***!
  \*******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "FluentMaterial": () => (/* binding */ FluentMaterial),
/* harmony export */   "FluentMaterialDefines": () => (/* binding */ FluentMaterialDefines)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Maths/math.color */ "core/Misc/observable");
/* harmony import */ var core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _shaders_fluent_vertex__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./shaders/fluent.vertex */ "../../../lts/gui/dist/3D/materials/fluent/shaders/fluent.vertex.js");
/* harmony import */ var _shaders_fluent_fragment__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./shaders/fluent.fragment */ "../../../lts/gui/dist/3D/materials/fluent/shaders/fluent.fragment.js");











/** @hidden */
var FluentMaterialDefines = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(FluentMaterialDefines, _super);
    function FluentMaterialDefines() {
        var _this = _super.call(this) || this;
        _this.INNERGLOW = false;
        _this.BORDER = false;
        _this.HOVERLIGHT = false;
        _this.TEXTURE = false;
        _this.rebuild();
        return _this;
    }
    return FluentMaterialDefines;
}(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.MaterialDefines));

/**
 * Class used to render controls with fluent design
 */
var FluentMaterial = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(FluentMaterial, _super);
    /**
     * Creates a new Fluent material
     * @param name defines the name of the material
     * @param scene defines the hosting scene
     */
    function FluentMaterial(name, scene) {
        var _this = _super.call(this, name, scene) || this;
        /**
         * Gets or sets inner glow intensity. A value of 0 means no glow (default is 0.5)
         */
        _this.innerGlowColorIntensity = 0.5;
        /**
         * Gets or sets the inner glow color (white by default)
         */
        _this.innerGlowColor = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Color3(1.0, 1.0, 1.0);
        /**
         * Gets or sets the albedo color (Default is Color3(0.3, 0.35, 0.4))
         */
        _this.albedoColor = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Color3(0.3, 0.35, 0.4);
        /**
         * Gets or sets a boolean indicating if borders must be rendered (default is false)
         */
        _this.renderBorders = false;
        /**
         * Gets or sets border width (default is 0.5)
         */
        _this.borderWidth = 0.5;
        /**
         * Gets or sets a value indicating the smoothing value applied to border edges (0.02 by default)
         */
        _this.edgeSmoothingValue = 0.02;
        /**
         * Gets or sets the minimum value that can be applied to border width (default is 0.1)
         */
        _this.borderMinValue = 0.1;
        /**
         * Gets or sets a boolean indicating if hover light must be rendered (default is false)
         */
        _this.renderHoverLight = false;
        /**
         * Gets or sets the radius used to render the hover light (default is 1.0)
         */
        _this.hoverRadius = 0.01;
        /**
         * Gets or sets the color used to render the hover light (default is Color4(0.3, 0.3, 0.3, 1.0))
         */
        _this.hoverColor = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Color4(0.3, 0.3, 0.3, 1.0);
        /**
         * Gets or sets the hover light position in world space (default is Vector3.Zero())
         */
        _this.hoverPosition = core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector3.Zero();
        return _this;
    }
    FluentMaterial.prototype.needAlphaBlending = function () {
        return this.alpha !== 1.0;
    };
    FluentMaterial.prototype.needAlphaTesting = function () {
        return false;
    };
    FluentMaterial.prototype.getAlphaTestTexture = function () {
        return null;
    };
    FluentMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh) {
        if (this.isFrozen) {
            if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {
                return true;
            }
        }
        if (!subMesh.materialDefines) {
            subMesh.materialDefines = new FluentMaterialDefines();
        }
        var scene = this.getScene();
        var defines = subMesh.materialDefines;
        if (!this.checkReadyOnEveryCall && subMesh.effect) {
            if (defines._renderId === scene.getRenderId()) {
                return true;
            }
        }
        if (defines._areTexturesDirty) {
            defines.INNERGLOW = this.innerGlowColorIntensity > 0;
            defines.BORDER = this.renderBorders;
            defines.HOVERLIGHT = this.renderHoverLight;
            if (this._albedoTexture) {
                if (!this._albedoTexture.isReadyOrNotBlocking()) {
                    return false;
                }
                else {
                    defines.TEXTURE = true;
                }
            }
            else {
                defines.TEXTURE = false;
            }
        }
        var engine = scene.getEngine();
        // Get correct effect
        if (defines.isDirty) {
            defines.markAsProcessed();
            scene.resetCachedMaterial();
            //Attributes
            var attribs = [core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.VertexBuffer.PositionKind];
            attribs.push(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.VertexBuffer.NormalKind);
            attribs.push(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.VertexBuffer.UVKind);
            var shaderName = "fluent";
            var uniforms = [
                "world",
                "viewProjection",
                "innerGlowColor",
                "albedoColor",
                "borderWidth",
                "edgeSmoothingValue",
                "scaleFactor",
                "borderMinValue",
                "hoverColor",
                "hoverPosition",
                "hoverRadius",
                "textureMatrix",
            ];
            var samplers = ["albedoSampler"];
            var uniformBuffers = new Array();
            core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.MaterialHelper.PrepareUniformsAndSamplersList({
                uniformsNames: uniforms,
                uniformBuffersNames: uniformBuffers,
                samplers: samplers,
                defines: defines,
                maxSimultaneousLights: 4,
            });
            var join = defines.toString();
            subMesh.setEffect(scene.getEngine().createEffect(shaderName, {
                attributes: attribs,
                uniformsNames: uniforms,
                uniformBuffersNames: uniformBuffers,
                samplers: samplers,
                defines: join,
                fallbacks: null,
                onCompiled: this.onCompiled,
                onError: this.onError,
                indexParameters: { maxSimultaneousLights: 4 },
            }, engine), defines, this._materialContext);
        }
        if (!subMesh.effect || !subMesh.effect.isReady()) {
            return false;
        }
        defines._renderId = scene.getRenderId();
        subMesh.effect._wasPreviouslyReady = true;
        return true;
    };
    FluentMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) {
        var scene = this.getScene();
        var defines = subMesh.materialDefines;
        if (!defines) {
            return;
        }
        var effect = subMesh.effect;
        if (!effect) {
            return;
        }
        this._activeEffect = effect;
        // Matrices
        this.bindOnlyWorldMatrix(world);
        this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
        if (this._mustRebind(scene, effect)) {
            this._activeEffect.setColor4("albedoColor", this.albedoColor, this.alpha);
            if (defines.INNERGLOW) {
                this._activeEffect.setColor4("innerGlowColor", this.innerGlowColor, this.innerGlowColorIntensity);
            }
            if (defines.BORDER) {
                this._activeEffect.setFloat("borderWidth", this.borderWidth);
                this._activeEffect.setFloat("edgeSmoothingValue", this.edgeSmoothingValue);
                this._activeEffect.setFloat("borderMinValue", this.borderMinValue);
                mesh.getBoundingInfo().boundingBox.extendSize.multiplyToRef(mesh.scaling, core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.TmpVectors.Vector3[0]);
                this._activeEffect.setVector3("scaleFactor", core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.TmpVectors.Vector3[0]);
            }
            if (defines.HOVERLIGHT) {
                this._activeEffect.setDirectColor4("hoverColor", this.hoverColor);
                this._activeEffect.setFloat("hoverRadius", this.hoverRadius);
                this._activeEffect.setVector3("hoverPosition", this.hoverPosition);
            }
            if (defines.TEXTURE && this._albedoTexture) {
                this._activeEffect.setTexture("albedoSampler", this._albedoTexture);
                var matrix = this._albedoTexture.getTextureMatrix();
                this._activeEffect.setMatrix("textureMatrix", matrix);
            }
        }
        this._afterBind(mesh, this._activeEffect);
    };
    FluentMaterial.prototype.getActiveTextures = function () {
        var activeTextures = _super.prototype.getActiveTextures.call(this);
        return activeTextures;
    };
    FluentMaterial.prototype.hasTexture = function (texture) {
        if (_super.prototype.hasTexture.call(this, texture)) {
            return true;
        }
        return false;
    };
    FluentMaterial.prototype.dispose = function (forceDisposeEffect) {
        _super.prototype.dispose.call(this, forceDisposeEffect);
    };
    FluentMaterial.prototype.clone = function (name) {
        var _this = this;
        return core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.SerializationHelper.Clone(function () { return new FluentMaterial(name, _this.getScene()); }, this);
    };
    FluentMaterial.prototype.serialize = function () {
        var serializationObject = _super.prototype.serialize.call(this);
        serializationObject.customType = "BABYLON.GUI.FluentMaterial";
        return serializationObject;
    };
    FluentMaterial.prototype.getClassName = function () {
        return "FluentMaterial";
    };
    // Statics
    FluentMaterial.Parse = function (source, scene, rootUrl) {
        return core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.SerializationHelper.Parse(function () { return new FluentMaterial(source.name, scene); }, source, scene, rootUrl);
    };
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)(),
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.expandToProperty)("_markAllSubMeshesAsTexturesDirty")
    ], FluentMaterial.prototype, "innerGlowColorIntensity", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serializeAsColor3)()
    ], FluentMaterial.prototype, "innerGlowColor", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serializeAsColor3)()
    ], FluentMaterial.prototype, "albedoColor", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)(),
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.expandToProperty)("_markAllSubMeshesAsTexturesDirty")
    ], FluentMaterial.prototype, "renderBorders", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentMaterial.prototype, "borderWidth", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentMaterial.prototype, "edgeSmoothingValue", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentMaterial.prototype, "borderMinValue", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)(),
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.expandToProperty)("_markAllSubMeshesAsTexturesDirty")
    ], FluentMaterial.prototype, "renderHoverLight", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentMaterial.prototype, "hoverRadius", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serializeAsColor4)()
    ], FluentMaterial.prototype, "hoverColor", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serializeAsVector3)()
    ], FluentMaterial.prototype, "hoverPosition", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serializeAsTexture)("albedoTexture")
    ], FluentMaterial.prototype, "_albedoTexture", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.expandToProperty)("_markAllSubMeshesAsTexturesAndMiscDirty")
    ], FluentMaterial.prototype, "albedoTexture", void 0);
    return FluentMaterial;
}(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.PushMaterial));

(0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.RegisterClass)("BABYLON.GUI.FluentMaterial", FluentMaterial);


/***/ }),

/***/ "../../../lts/gui/dist/3D/materials/fluent/index.js":
/*!**********************************************************!*\
  !*** ../../../lts/gui/dist/3D/materials/fluent/index.js ***!
  \**********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "FluentMaterial": () => (/* reexport safe */ _fluentMaterial__WEBPACK_IMPORTED_MODULE_0__.FluentMaterial),
/* harmony export */   "FluentMaterialDefines": () => (/* reexport safe */ _fluentMaterial__WEBPACK_IMPORTED_MODULE_0__.FluentMaterialDefines)
/* harmony export */ });
/* harmony import */ var _fluentMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./fluentMaterial */ "../../../lts/gui/dist/3D/materials/fluent/fluentMaterial.js");



/***/ }),

/***/ "../../../lts/gui/dist/3D/materials/fluent/shaders/fluent.fragment.js":
/*!****************************************************************************!*\
  !*** ../../../lts/gui/dist/3D/materials/fluent/shaders/fluent.fragment.js ***!
  \****************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "fluentPixelShader": () => (/* binding */ fluentPixelShader)
/* harmony export */ });
/* harmony import */ var core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Engines/shaderStore */ "core/Misc/observable");
/* harmony import */ var core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);
// Do not edit.

var name = "fluentPixelShader";
var shader = "precision highp float;\nvarying vec2 vUV;\nuniform vec4 albedoColor;\n#ifdef INNERGLOW\nuniform vec4 innerGlowColor;\n#endif\n#ifdef BORDER\nvarying vec2 scaleInfo;\nuniform float edgeSmoothingValue;\nuniform float borderMinValue;\n#endif\n#ifdef HOVERLIGHT\nvarying vec3 worldPosition;\nuniform vec3 hoverPosition;\nuniform vec4 hoverColor;\nuniform float hoverRadius;\n#endif\n#ifdef TEXTURE\nuniform sampler2D albedoSampler;\nuniform mat4 textureMatrix;\nvec2 finalUV;\n#endif\nvoid main(void) {\nvec3 albedo=albedoColor.rgb;\nfloat alpha=albedoColor.a;\n#ifdef TEXTURE\nfinalUV=vec2(textureMatrix*vec4(vUV,1.0,0.0));\nalbedo=texture2D(albedoSampler,finalUV).rgb;\n#endif\n#ifdef HOVERLIGHT\nfloat pointToHover=(1.0-clamp(length(hoverPosition-worldPosition)/hoverRadius,0.,1.))*hoverColor.a;\nalbedo=clamp(albedo+hoverColor.rgb*pointToHover,0.,1.);\n#else\nfloat pointToHover=1.0;\n#endif\n#ifdef BORDER \nfloat borderPower=10.0;\nfloat inverseBorderPower=1.0/borderPower;\nvec3 borderColor=albedo*borderPower;\nvec2 distanceToEdge;\ndistanceToEdge.x=abs(vUV.x-0.5)*2.0;\ndistanceToEdge.y=abs(vUV.y-0.5)*2.0;\nfloat borderValue=max(smoothstep(scaleInfo.x-edgeSmoothingValue,scaleInfo.x+edgeSmoothingValue,distanceToEdge.x),\nsmoothstep(scaleInfo.y-edgeSmoothingValue,scaleInfo.y+edgeSmoothingValue,distanceToEdge.y));\nborderColor=borderColor*borderValue*max(borderMinValue*inverseBorderPower,pointToHover); \nalbedo+=borderColor;\nalpha=max(alpha,borderValue);\n#endif\n#ifdef INNERGLOW\nvec2 uvGlow=(vUV-vec2(0.5,0.5))*(innerGlowColor.a*2.0);\nuvGlow=uvGlow*uvGlow;\nuvGlow=uvGlow*uvGlow;\nalbedo+=mix(vec3(0.0,0.0,0.0),innerGlowColor.rgb,uvGlow.x+uvGlow.y); \n#endif\ngl_FragColor=vec4(albedo,alpha);\n}";
// Sideeffect
core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__.ShaderStore.ShadersStore[name] = shader;
/** @hidden */
var fluentPixelShader = { name: name, shader: shader };


/***/ }),

/***/ "../../../lts/gui/dist/3D/materials/fluent/shaders/fluent.vertex.js":
/*!**************************************************************************!*\
  !*** ../../../lts/gui/dist/3D/materials/fluent/shaders/fluent.vertex.js ***!
  \**************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "fluentVertexShader": () => (/* binding */ fluentVertexShader)
/* harmony export */ });
/* harmony import */ var core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Engines/shaderStore */ "core/Misc/observable");
/* harmony import */ var core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);
// Do not edit.

var name = "fluentVertexShader";
var shader = "precision highp float;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nuniform mat4 world;\nuniform mat4 viewProjection;\nvarying vec2 vUV;\n#ifdef BORDER\nvarying vec2 scaleInfo;\nuniform float borderWidth;\nuniform vec3 scaleFactor;\n#endif\n#ifdef HOVERLIGHT\nvarying vec3 worldPosition;\n#endif\nvoid main(void) {\nvUV=uv;\n#ifdef BORDER\nvec3 scale=scaleFactor;\nfloat minScale=min(min(scale.x,scale.y),scale.z);\nfloat maxScale=max(max(scale.x,scale.y),scale.z);\nfloat minOverMiddleScale=minScale/(scale.x+scale.y+scale.z-minScale-maxScale);\nfloat areaYZ=scale.y*scale.z;\nfloat areaXZ=scale.x*scale.z;\nfloat areaXY=scale.x*scale.y;\nfloat scaledBorderWidth=borderWidth; \nif (abs(normal.x)==1.0) \n{\nscale.x=scale.y;\nscale.y=scale.z;\nif (areaYZ>areaXZ && areaYZ>areaXY)\n{\nscaledBorderWidth*=minOverMiddleScale;\n}\n}\nelse if (abs(normal.y)==1.0) \n{\nscale.x=scale.z;\nif (areaXZ>areaXY && areaXZ>areaYZ)\n{\nscaledBorderWidth*=minOverMiddleScale;\n}\n}\nelse \n{\nif (areaXY>areaYZ && areaXY>areaXZ)\n{\nscaledBorderWidth*=minOverMiddleScale;\n}\n}\nfloat scaleRatio=min(scale.x,scale.y)/max(scale.x,scale.y);\nif (scale.x>scale.y)\n{\nscaleInfo.x=1.0-(scaledBorderWidth*scaleRatio);\nscaleInfo.y=1.0-scaledBorderWidth;\n}\nelse\n{\nscaleInfo.x=1.0-scaledBorderWidth;\nscaleInfo.y=1.0-(scaledBorderWidth*scaleRatio);\n} \n#endif \nvec4 worldPos=world*vec4(position,1.0);\n#ifdef HOVERLIGHT\nworldPosition=worldPos.xyz;\n#endif\ngl_Position=viewProjection*worldPos;\n}\n";
// Sideeffect
core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__.ShaderStore.ShadersStore[name] = shader;
/** @hidden */
var fluentVertexShader = { name: name, shader: shader };


/***/ }),

/***/ "../../../lts/gui/dist/3D/materials/fluentBackplate/fluentBackplateMaterial.js":
/*!*************************************************************************************!*\
  !*** ../../../lts/gui/dist/3D/materials/fluentBackplate/fluentBackplateMaterial.js ***!
  \*************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "FluentBackplateMaterial": () => (/* binding */ FluentBackplateMaterial)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Engines/constants */ "core/Misc/observable");
/* harmony import */ var core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _shaders_fluentBackplate_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./shaders/fluentBackplate.fragment */ "../../../lts/gui/dist/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.js");
/* harmony import */ var _shaders_fluentBackplate_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./shaders/fluentBackplate.vertex */ "../../../lts/gui/dist/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.js");














/** @hidden */
var FluentBackplateMaterialDefines = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(FluentBackplateMaterialDefines, _super);
    function FluentBackplateMaterialDefines() {
        var _this = _super.call(this) || this;
        _this.BLOB_ENABLE = true;
        _this.BLOB_ENABLE_2 = true;
        _this.SMOOTH_EDGES = true;
        _this.IRIDESCENT_MAP_ENABLE = true;
        _this._needNormals = true;
        _this.rebuild();
        return _this;
    }
    return FluentBackplateMaterialDefines;
}(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.MaterialDefines));
/**
 * Class used to render square buttons with fluent design
 */
var FluentBackplateMaterial = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(FluentBackplateMaterial, _super);
    function FluentBackplateMaterial(name, scene) {
        var _this = _super.call(this, name, scene) || this;
        /**
         * Gets or sets the corner radius on the backplate. Best to keep this value between 0.01 and 0.5. Default is 0.03.
         */
        _this.radius = 0.03;
        /**
         * Gets or sets the line width of the backplate.
         */
        _this.lineWidth = 0.01;
        /**
         * Gets or sets whether to use absolute sizes when calculating effects on the backplate.
         * Since desktop and VR/AR have different relative sizes, it's usually best to keep this false.
         */
        _this.absoluteSizes = false;
        /** @hidden */
        _this._filterWidth = 1;
        /**
         * Gets or sets the base color of the backplate.
         */
        _this.baseColor = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Color4(0.0392157, 0.0666667, 0.207843, 1);
        /**
         * Gets or sets the line color of the backplate.
         */
        _this.lineColor = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Color4(0.14902, 0.133333, 0.384314, 1);
        /**
         * Gets or sets the intensity of the fluent hover glow effect.
         */
        _this.blobIntensity = 0.98;
        /**
         * Gets or sets the far size of the fluent hover glow effect.
         */
        _this.blobFarSize = 0.04;
        /**
         * Gets or sets the distance considered "near" to the backplate, which controls the size of the fluent hover glow effect (see blobNearSize).
         */
        _this.blobNearDistance = 0;
        /**
         * Gets or sets the distance considered "far" from the backplate, which controls the size of the fluent hover glow effect (see blobFarSize).
         */
        _this.blobFarDistance = 0.08;
        /**
         * Gets or sets the length of the fluent hover glow effect fade.
         */
        _this.blobFadeLength = 0.08;
        /**
         * Gets or sets the size of the fluent hover glow effect when the left pointer is considered "near" to the backplate (see blobNearDistance).
         */
        _this.blobNearSize = 0.22;
        /**
         * Gets or sets the progress of the fluent hover glow effect selection animation corresponding to the left pointer (0.0 - 1.0).
         */
        _this.blobPulse = 0;
        /**
         * Gets or sets the opacity of the fluent hover glow effect corresponding to the left pointer (0.0 - 1.0). Default is 0.
         */
        _this.blobFade = 0;
        /**
         * Gets or sets the size of the fluent hover glow effect when the right pointer is considered "near" to the backplate (see blobNearDistance).
         */
        _this.blobNearSize2 = 0.22;
        /**
         * Gets or sets the progress of the fluent hover glow effect selection animation corresponding to the right pointer (0.0 - 1.0).
         */
        _this.blobPulse2 = 0;
        /**
         * Gets or sets the opacity of the fluent hover glow effect corresponding to the right pointer (0.0 - 1.0). Default is 0.
         */
        _this.blobFade2 = 0;
        /** @hidden */
        _this._rate = 0.135;
        /**
         * Gets or sets the color of the highlights on the backplate line.
         */
        _this.highlightColor = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Color4(0.98, 0.98, 0.98, 1);
        /**
         * Gets or sets the width of the highlights on the backplate line.
         */
        _this.highlightWidth = 0.25;
        /** @hidden */
        _this._highlightTransform = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector4(1, 1, 0, 0);
        /** @hidden */
        _this._highlight = 1;
        /**
         * Gets or sets the intensity of the iridescence effect.
         */
        _this.iridescenceIntensity = 0;
        /**
         * Gets or sets the intensity of the iridescence effect on the backplate edges.
         */
        _this.iridescenceEdgeIntensity = 1;
        /** @hidden */
        _this._angle = -45;
        /**
         * Gets or sets the opacity of the backplate (0.0 - 1.0).
         */
        _this.fadeOut = 1;
        /** @hidden */
        _this._reflected = true;
        /** @hidden */
        _this._frequency = 1;
        /** @hidden */
        _this._verticalOffset = 0;
        /**
         * Gets or sets the world-space position of the tip of the left index finger.
         */
        _this.globalLeftIndexTipPosition = core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector3.Zero();
        _this._globalLeftIndexTipPosition4 = core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector4.Zero();
        /**
         * Gets or sets the world-space position of the tip of the right index finger.
         */
        _this.globalRightIndexTipPosition = core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector3.Zero();
        _this._globalRightIndexTipPosition4 = core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector4.Zero();
        _this.alphaMode = core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Constants.ALPHA_DISABLE;
        _this.backFaceCulling = false;
        _this._blobTexture = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Texture(FluentBackplateMaterial.BLOB_TEXTURE_URL, _this.getScene(), true, false, core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Texture.NEAREST_SAMPLINGMODE);
        _this._iridescentMap = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Texture(FluentBackplateMaterial.IM_TEXTURE_URL, _this.getScene(), true, false, core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Texture.NEAREST_SAMPLINGMODE);
        return _this;
    }
    FluentBackplateMaterial.prototype.needAlphaBlending = function () {
        return false;
    };
    FluentBackplateMaterial.prototype.needAlphaTesting = function () {
        return false;
    };
    FluentBackplateMaterial.prototype.getAlphaTestTexture = function () {
        return null;
    };
    FluentBackplateMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh) {
        if (this.isFrozen) {
            if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {
                return true;
            }
        }
        if (!subMesh.materialDefines) {
            subMesh.materialDefines = new FluentBackplateMaterialDefines();
        }
        var defines = subMesh.materialDefines;
        var scene = this.getScene();
        if (this._isReadyForSubMesh(subMesh)) {
            return true;
        }
        var engine = scene.getEngine();
        // Attribs
        core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, false, false);
        // Get correct effect
        if (defines.isDirty) {
            defines.markAsProcessed();
            scene.resetCachedMaterial();
            // Fallbacks
            var fallbacks = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.EffectFallbacks();
            if (defines.FOG) {
                fallbacks.addFallback(1, "FOG");
            }
            core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.MaterialHelper.HandleFallbacksForShadows(defines, fallbacks);
            defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;
            //Attributes
            var attribs = [core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.VertexBuffer.PositionKind];
            if (defines.NORMAL) {
                attribs.push(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.VertexBuffer.NormalKind);
            }
            if (defines.UV1) {
                attribs.push(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.VertexBuffer.UVKind);
            }
            if (defines.UV2) {
                attribs.push(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.VertexBuffer.UV2Kind);
            }
            if (defines.VERTEXCOLOR) {
                attribs.push(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.VertexBuffer.ColorKind);
            }
            if (defines.TANGENT) {
                attribs.push(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.VertexBuffer.TangentKind);
            }
            core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.MaterialHelper.PrepareAttributesForInstances(attribs, defines);
            // Legacy browser patch
            var shaderName = "fluentBackplate";
            var join = defines.toString();
            var uniforms = [
                "world",
                "viewProjection",
                "cameraPosition",
                "_Radius_",
                "_Line_Width_",
                "_Absolute_Sizes_",
                "_Filter_Width_",
                "_Base_Color_",
                "_Line_Color_",
                "_Radius_Top_Left_",
                "_Radius_Top_Right_",
                "_Radius_Bottom_Left_",
                "_Radius_Bottom_Right_",
                "_Blob_Position_",
                "_Blob_Intensity_",
                "_Blob_Near_Size_",
                "_Blob_Far_Size_",
                "_Blob_Near_Distance_",
                "_Blob_Far_Distance_",
                "_Blob_Fade_Length_",
                "_Blob_Pulse_",
                "_Blob_Fade_",
                "_Blob_Texture_",
                "_Blob_Position_2_",
                "_Blob_Near_Size_2_",
                "_Blob_Pulse_2_",
                "_Blob_Fade_2_",
                "_Rate_",
                "_Highlight_Color_",
                "_Highlight_Width_",
                "_Highlight_Transform_",
                "_Highlight_",
                "_Iridescence_Intensity_",
                "_Iridescence_Edge_Intensity_",
                "_Angle_",
                "_Fade_Out_",
                "_Reflected_",
                "_Frequency_",
                "_Vertical_Offset_",
                "_Iridescent_Map_",
                "_Use_Global_Left_Index_",
                "_Use_Global_Right_Index_",
                "Global_Left_Index_Tip_Position",
                "Global_Right_Index_Tip_Position",
            ];
            var samplers = ["_Blob_Texture_", "_Iridescent_Map_"];
            var uniformBuffers = new Array();
            core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.MaterialHelper.PrepareUniformsAndSamplersList({
                uniformsNames: uniforms,
                uniformBuffersNames: uniformBuffers,
                samplers: samplers,
                defines: defines,
                maxSimultaneousLights: 4,
            });
            subMesh.setEffect(scene.getEngine().createEffect(shaderName, {
                attributes: attribs,
                uniformsNames: uniforms,
                uniformBuffersNames: uniformBuffers,
                samplers: samplers,
                defines: join,
                fallbacks: fallbacks,
                onCompiled: this.onCompiled,
                onError: this.onError,
                indexParameters: { maxSimultaneousLights: 4 },
            }, engine), defines, this._materialContext);
        }
        if (!subMesh.effect || !subMesh.effect.isReady()) {
            return false;
        }
        defines._renderId = scene.getRenderId();
        subMesh.effect._wasPreviouslyReady = true;
        return true;
    };
    FluentBackplateMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) {
        var _a, _b;
        var defines = subMesh.materialDefines;
        if (!defines) {
            return;
        }
        var effect = subMesh.effect;
        if (!effect) {
            return;
        }
        this._activeEffect = effect;
        // Matrices
        this.bindOnlyWorldMatrix(world);
        this._activeEffect.setMatrix("viewProjection", this.getScene().getTransformMatrix());
        this._activeEffect.setVector3("cameraPosition", (_b = (_a = this.getScene().activeCamera) === null || _a === void 0 ? void 0 : _a.position) !== null && _b !== void 0 ? _b : core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector3.ZeroReadOnly);
        // "Round Rect"
        this._activeEffect.setFloat("_Radius_", this.radius);
        this._activeEffect.setFloat("_Line_Width_", this.lineWidth);
        this._activeEffect.setFloat("_Absolute_Sizes_", this.absoluteSizes ? 1.0 : 0.0);
        this._activeEffect.setFloat("_Filter_Width_", this._filterWidth);
        this._activeEffect.setDirectColor4("_Base_Color_", this.baseColor);
        this._activeEffect.setDirectColor4("_Line_Color_", this.lineColor);
        // "Radii Multipliers"
        this._activeEffect.setFloat("_Radius_Top_Left_", 1);
        this._activeEffect.setFloat("_Radius_Top_Right_", 1.0);
        this._activeEffect.setFloat("_Radius_Bottom_Left_", 1.0);
        this._activeEffect.setFloat("_Radius_Bottom_Right_", 1.0);
        // "Blob"
        //define BLOB_ENABLE true;
        this._activeEffect.setFloat("_Blob_Intensity_", this.blobIntensity);
        this._activeEffect.setFloat("_Blob_Near_Size_", this.blobNearSize);
        this._activeEffect.setFloat("_Blob_Far_Size_", this.blobFarSize);
        this._activeEffect.setFloat("_Blob_Near_Distance_", this.blobNearDistance);
        this._activeEffect.setFloat("_Blob_Far_Distance_", this.blobFarDistance);
        this._activeEffect.setFloat("_Blob_Fade_Length_", this.blobFadeLength);
        this._activeEffect.setFloat("_Blob_Pulse_", this.blobPulse);
        this._activeEffect.setFloat("_Blob_Fade_", this.blobFade);
        // "Blob Texture"
        this._activeEffect.setTexture("_Blob_Texture_", this._blobTexture);
        // "Blob 2"
        //define BLOB_ENABLE_2 true;
        this._activeEffect.setFloat("_Blob_Near_Size_2_", this.blobNearSize2);
        this._activeEffect.setFloat("_Blob_Pulse_2_", this.blobPulse2);
        this._activeEffect.setFloat("_Blob_Fade_2_", this.blobFade2);
        // "Line Highlight"
        this._activeEffect.setFloat("_Rate_", this._rate);
        this._activeEffect.setDirectColor4("_Highlight_Color_", this.highlightColor);
        this._activeEffect.setFloat("_Highlight_Width_", this.highlightWidth);
        this._activeEffect.setVector4("_Highlight_Transform_", this._highlightTransform);
        this._activeEffect.setFloat("_Highlight_", this._highlight);
        // "Iridescence"
        this._activeEffect.setFloat("_Iridescence_Intensity_", this.iridescenceIntensity);
        this._activeEffect.setFloat("_Iridescence_Edge_Intensity_", this.iridescenceEdgeIntensity);
        this._activeEffect.setFloat("_Angle_", this._angle);
        // "Fade"
        this._activeEffect.setFloat("_Fade_Out_", this.fadeOut);
        // "Antialiasing"
        //define SMOOTH_EDGES true;
        // "ChooseAngle"
        this._activeEffect.setFloat("_Reflected_", this._reflected ? 1.0 : 0.0);
        // "Multiply"
        this._activeEffect.setFloat("_Frequency_", this._frequency);
        this._activeEffect.setFloat("_Vertical_Offset_", this._verticalOffset);
        // "Color Texture"
        //define IRIDESCENT_MAP_ENABLE true;
        this._activeEffect.setTexture("_Iridescent_Map_", this._iridescentMap);
        // "Global"
        this._activeEffect.setFloat("_Use_Global_Left_Index_", 1.0);
        this._activeEffect.setFloat("_Use_Global_Right_Index_", 1.0);
        this._globalLeftIndexTipPosition4.set(this.globalLeftIndexTipPosition.x, this.globalLeftIndexTipPosition.y, this.globalLeftIndexTipPosition.z, 1.0);
        this._activeEffect.setVector4("Global_Left_Index_Tip_Position", this._globalLeftIndexTipPosition4);
        this._globalRightIndexTipPosition4.set(this.globalRightIndexTipPosition.x, this.globalRightIndexTipPosition.y, this.globalRightIndexTipPosition.z, 1.0);
        this._activeEffect.setVector4("Global_Right_Index_Tip_Position", this._globalRightIndexTipPosition4);
        this._afterBind(mesh, this._activeEffect);
    };
    /**
     * Get the list of animatables in the material.
     * @returns the list of animatables object used in the material
     */
    FluentBackplateMaterial.prototype.getAnimatables = function () {
        return [];
    };
    FluentBackplateMaterial.prototype.dispose = function (forceDisposeEffect) {
        _super.prototype.dispose.call(this, forceDisposeEffect);
        this._blobTexture.dispose();
        this._iridescentMap.dispose();
    };
    FluentBackplateMaterial.prototype.clone = function (name) {
        var _this = this;
        return core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.SerializationHelper.Clone(function () { return new FluentBackplateMaterial(name, _this.getScene()); }, this);
    };
    FluentBackplateMaterial.prototype.serialize = function () {
        var serializationObject = _super.prototype.serialize.call(this);
        serializationObject.customType = "BABYLON.FluentBackplateMaterial";
        return serializationObject;
    };
    FluentBackplateMaterial.prototype.getClassName = function () {
        return "FluentBackplateMaterial";
    };
    // Statics
    FluentBackplateMaterial.Parse = function (source, scene, rootUrl) {
        return core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.SerializationHelper.Parse(function () { return new FluentBackplateMaterial(source.name, scene); }, source, scene, rootUrl);
    };
    /**
     * URL pointing to the texture used to define the coloring for the fluent blob effect.
     */
    FluentBackplateMaterial.BLOB_TEXTURE_URL = "https://assets.babylonjs.com/meshes/MRTK/mrtk-fluent-backplate-blob.png";
    /**
     * URL pointing to the texture used to define iridescent map.
     */
    FluentBackplateMaterial.IM_TEXTURE_URL = "https://assets.babylonjs.com/meshes/MRTK/mrtk-fluent-backplate-iridescence.png";
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentBackplateMaterial.prototype, "radius", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentBackplateMaterial.prototype, "lineWidth", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentBackplateMaterial.prototype, "absoluteSizes", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentBackplateMaterial.prototype, "baseColor", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentBackplateMaterial.prototype, "lineColor", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentBackplateMaterial.prototype, "blobIntensity", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentBackplateMaterial.prototype, "blobFarSize", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentBackplateMaterial.prototype, "blobNearDistance", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentBackplateMaterial.prototype, "blobFarDistance", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentBackplateMaterial.prototype, "blobFadeLength", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentBackplateMaterial.prototype, "blobNearSize", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentBackplateMaterial.prototype, "blobPulse", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentBackplateMaterial.prototype, "blobFade", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentBackplateMaterial.prototype, "blobNearSize2", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentBackplateMaterial.prototype, "blobPulse2", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentBackplateMaterial.prototype, "blobFade2", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentBackplateMaterial.prototype, "highlightColor", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentBackplateMaterial.prototype, "highlightWidth", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentBackplateMaterial.prototype, "iridescenceIntensity", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentBackplateMaterial.prototype, "iridescenceEdgeIntensity", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentBackplateMaterial.prototype, "fadeOut", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serializeAsVector3)()
    ], FluentBackplateMaterial.prototype, "globalLeftIndexTipPosition", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serializeAsVector3)()
    ], FluentBackplateMaterial.prototype, "globalRightIndexTipPosition", void 0);
    return FluentBackplateMaterial;
}(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.PushMaterial));

(0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.RegisterClass)("BABYLON.GUI.FluentBackplateMaterial", FluentBackplateMaterial);


/***/ }),

/***/ "../../../lts/gui/dist/3D/materials/fluentBackplate/index.js":
/*!*******************************************************************!*\
  !*** ../../../lts/gui/dist/3D/materials/fluentBackplate/index.js ***!
  \*******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "FluentBackplateMaterial": () => (/* reexport safe */ _fluentBackplateMaterial__WEBPACK_IMPORTED_MODULE_0__.FluentBackplateMaterial)
/* harmony export */ });
/* harmony import */ var _fluentBackplateMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./fluentBackplateMaterial */ "../../../lts/gui/dist/3D/materials/fluentBackplate/fluentBackplateMaterial.js");



/***/ }),

/***/ "../../../lts/gui/dist/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.js":
/*!**********************************************************************************************!*\
  !*** ../../../lts/gui/dist/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.js ***!
  \**********************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "fluentBackplatePixelShader": () => (/* binding */ fluentBackplatePixelShader)
/* harmony export */ });
/* harmony import */ var core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Engines/shaderStore */ "core/Misc/observable");
/* harmony import */ var core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);
// Do not edit.

var name = "fluentBackplatePixelShader";
var shader = "uniform vec3 cameraPosition;\nvarying vec3 vPosition;\nvarying vec3 vNormal;\nvarying vec2 vUV;\nvarying vec3 vTangent;\nvarying vec3 vBinormal;\nvarying vec4 vColor;\nvarying vec4 vExtra1;\nvarying vec4 vExtra2;\nvarying vec4 vExtra3;\nuniform float _Radius_;\nuniform float _Line_Width_;\nuniform bool _Absolute_Sizes_;\nuniform float _Filter_Width_;\nuniform vec4 _Base_Color_;\nuniform vec4 _Line_Color_;\nuniform float _Radius_Top_Left_;\nuniform float _Radius_Top_Right_;\nuniform float _Radius_Bottom_Left_;\nuniform float _Radius_Bottom_Right_;\nuniform vec3 _Blob_Position_;\nuniform float _Blob_Intensity_;\nuniform float _Blob_Near_Size_;\nuniform float _Blob_Far_Size_;\nuniform float _Blob_Near_Distance_;\nuniform float _Blob_Far_Distance_;\nuniform float _Blob_Fade_Length_;\nuniform float _Blob_Pulse_;\nuniform float _Blob_Fade_;\nuniform sampler2D _Blob_Texture_;\nuniform vec3 _Blob_Position_2_;\nuniform float _Blob_Near_Size_2_;\nuniform float _Blob_Pulse_2_;\nuniform float _Blob_Fade_2_;\nuniform float _Rate_;\nuniform vec4 _Highlight_Color_;\nuniform float _Highlight_Width_;\nuniform vec4 _Highlight_Transform_;\nuniform float _Highlight_;\nuniform float _Iridescence_Intensity_;\nuniform float _Iridescence_Edge_Intensity_;\nuniform float _Angle_;\nuniform float _Fade_Out_;\nuniform bool _Reflected_;\nuniform float _Frequency_;\nuniform float _Vertical_Offset_;\nuniform sampler2D _Iridescent_Map_;\nuniform bool _Use_Global_Left_Index_;\nuniform bool _Use_Global_Right_Index_;\nuniform vec4 Global_Left_Index_Tip_Position;\nuniform vec4 Global_Right_Index_Tip_Position;\nvoid Round_Rect_Fragment_B31(\nfloat Radius,\nfloat Line_Width,\nvec4 Line_Color,\nfloat Filter_Width,\nvec2 UV,\nfloat Line_Visibility,\nvec4 Rect_Parms,\nvec4 Fill_Color,\nout vec4 Color)\n{\nfloat d=length(max(abs(UV)-Rect_Parms.xy,0.0));\nfloat dx=max(fwidth(d)*Filter_Width,0.00001);\nfloat g=min(Rect_Parms.z,Rect_Parms.w);\nfloat dgrad=max(fwidth(g)*Filter_Width,0.00001);\nfloat Inside_Rect=clamp(g/dgrad,0.0,1.0);\nfloat inner=clamp((d+dx*0.5-max(Radius-Line_Width,d-dx*0.5))/dx,0.0,1.0);\nColor=clamp(mix(Fill_Color,Line_Color,inner),0.0,1.0)*Inside_Rect;\n}\nvoid Blob_Fragment_B71(\nsampler2D Blob_Texture,\nvec4 Blob_Info1,\nvec4 Blob_Info2,\nout vec4 Blob_Color)\n{\nfloat k1=dot(Blob_Info1.xy,Blob_Info1.xy);\nfloat k2=dot(Blob_Info2.xy,Blob_Info2.xy);\nvec3 closer=k1<k2 ? vec3(k1,Blob_Info1.z,Blob_Info1.w) : vec3(k2,Blob_Info2.z,Blob_Info2.w);\nBlob_Color=closer.z*texture(Blob_Texture,vec2(vec2(sqrt(closer.x),closer.y).x,1.0-vec2(sqrt(closer.x),closer.y).y))*clamp(1.0-closer.x,0.0,1.0);\n}\nvoid Line_Fragment_B48(\nvec4 Base_Color,\nvec4 Highlight_Color,\nfloat Highlight_Width,\nvec3 Line_Vertex,\nfloat Highlight,\nout vec4 Line_Color)\n{\nfloat k2=1.0-clamp(abs(Line_Vertex.y/Highlight_Width),0.0,1.0);\nLine_Color=mix(Base_Color,Highlight_Color,Highlight*k2);\n}\nvoid Scale_RGB_B54(\nvec4 Color,\nfloat Scalar,\nout vec4 Result)\n{\nResult=vec4(Scalar,Scalar,Scalar,1)*Color;\n}\nvoid Conditional_Float_B38(\nbool Which,\nfloat If_True,\nfloat If_False,\nout float Result)\n{\nResult=Which ? If_True : If_False;\n}\nvoid main()\n{\nfloat R_Q72;\nfloat G_Q72;\nfloat B_Q72;\nfloat A_Q72;\nR_Q72=vColor.r; G_Q72=vColor.g; B_Q72=vColor.b; A_Q72=vColor.a;\nvec4 Blob_Color_Q71;\n#if BLOB_ENABLE\nfloat k1=dot(vExtra2.xy,vExtra2.xy);\nfloat k2=dot(vExtra3.xy,vExtra3.xy);\nvec3 closer=k1<k2 ? vec3(k1,vExtra2.z,vExtra2.w) : vec3(k2,vExtra3.z,vExtra3.w);\nBlob_Color_Q71=closer.z*texture(_Blob_Texture_,vec2(vec2(sqrt(closer.x),closer.y).x,1.0-vec2(sqrt(closer.x),closer.y).y))*clamp(1.0-closer.x,0.0,1.0);\n#else\nBlob_Color_Q71=vec4(0,0,0,0);\n#endif\nvec4 Line_Color_Q48;\nLine_Fragment_B48(_Line_Color_,_Highlight_Color_,_Highlight_Width_,vTangent,_Highlight_,Line_Color_Q48);\nfloat X_Q67;\nfloat Y_Q67;\nX_Q67=vUV.x;\nY_Q67=vUV.y;\nvec3 Incident_Q66=normalize(vPosition-cameraPosition);\nvec3 Reflected_Q60=reflect(Incident_Q66,vBinormal);\nfloat Product_Q63=Y_Q67*_Vertical_Offset_;\nfloat Dot_Q68=dot(Incident_Q66, Reflected_Q60);\nfloat Dot_Q57=dot(vNormal, Incident_Q66);\nfloat Result_Q38;\nConditional_Float_B38(_Reflected_,Dot_Q68,Dot_Q57,Result_Q38);\nfloat Product_Q64=Result_Q38*_Frequency_;\nfloat Sum_Q69=Product_Q64+1.0;\nfloat Product_Q70=Sum_Q69*0.5;\nfloat Sum_Q62=Product_Q63+Product_Q70;\nfloat FractF_Q59=fract(Sum_Q62);\nvec2 Vec2_Q65=vec2(FractF_Q59,0.5);\nvec4 Color_Q58;\n#if IRIDESCENT_MAP_ENABLE\nColor_Q58=texture(_Iridescent_Map_,Vec2_Q65);\n#else\nColor_Q58=vec4(0,0,0,0);\n#endif\nvec4 Result_Q54;\nScale_RGB_B54(Color_Q58,_Iridescence_Edge_Intensity_,Result_Q54);\nvec4 Result_Q55;\nScale_RGB_B54(Color_Q58,_Iridescence_Intensity_,Result_Q55);\nvec4 Base_And_Iridescent_Q53;\nBase_And_Iridescent_Q53=Line_Color_Q48+vec4(Result_Q54.rgb,0.0);\nvec4 Base_And_Iridescent_Q56;\nBase_And_Iridescent_Q56=_Base_Color_+vec4(Result_Q55.rgb,0.0);\nvec4 Result_Q52=Base_And_Iridescent_Q53; Result_Q52.a=1.0;\nvec4 Result_Q35=Blob_Color_Q71+(1.0-Blob_Color_Q71.a)*Base_And_Iridescent_Q56;\nvec4 Color_Q31;\nRound_Rect_Fragment_B31(R_Q72,G_Q72,Result_Q52,_Filter_Width_,vUV,1.0,vExtra1,Result_Q35,Color_Q31);\nvec4 Result_Q47=_Fade_Out_*Color_Q31;\nvec4 Out_Color=Result_Q47;\nfloat Clip_Threshold=0.001;\nbool To_sRGB=false;\ngl_FragColor=Out_Color;\n}";
// Sideeffect
core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__.ShaderStore.ShadersStore[name] = shader;
/** @hidden */
var fluentBackplatePixelShader = { name: name, shader: shader };


/***/ }),

/***/ "../../../lts/gui/dist/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.js":
/*!********************************************************************************************!*\
  !*** ../../../lts/gui/dist/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.js ***!
  \********************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "fluentBackplateVertexShader": () => (/* binding */ fluentBackplateVertexShader)
/* harmony export */ });
/* harmony import */ var core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Engines/shaderStore */ "core/Misc/observable");
/* harmony import */ var core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);
// Do not edit.

var name = "fluentBackplateVertexShader";
var shader = "uniform mat4 world;\nuniform mat4 viewProjection;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\n#ifdef TANGENT\nattribute vec3 tangent;\n#else\nconst vec3 tangent=vec3(0.);\n#endif\nuniform float _Radius_;\nuniform float _Line_Width_;\nuniform bool _Absolute_Sizes_;\nuniform float _Filter_Width_;\nuniform vec4 _Base_Color_;\nuniform vec4 _Line_Color_;\nuniform float _Radius_Top_Left_;\nuniform float _Radius_Top_Right_;\nuniform float _Radius_Bottom_Left_;\nuniform float _Radius_Bottom_Right_;\nuniform vec3 _Blob_Position_;\nuniform float _Blob_Intensity_;\nuniform float _Blob_Near_Size_;\nuniform float _Blob_Far_Size_;\nuniform float _Blob_Near_Distance_;\nuniform float _Blob_Far_Distance_;\nuniform float _Blob_Fade_Length_;\nuniform float _Blob_Pulse_;\nuniform float _Blob_Fade_;\nuniform sampler2D _Blob_Texture_;\nuniform vec3 _Blob_Position_2_;\nuniform float _Blob_Near_Size_2_;\nuniform float _Blob_Pulse_2_;\nuniform float _Blob_Fade_2_;\nuniform float _Rate_;\nuniform vec4 _Highlight_Color_;\nuniform float _Highlight_Width_;\nuniform vec4 _Highlight_Transform_;\nuniform float _Highlight_;\nuniform float _Iridescence_Intensity_;\nuniform float _Iridescence_Edge_Intensity_;\nuniform float _Angle_;\nuniform float _Fade_Out_;\nuniform bool _Reflected_;\nuniform float _Frequency_;\nuniform float _Vertical_Offset_;\nuniform sampler2D _Iridescent_Map_;\nuniform bool _Use_Global_Left_Index_;\nuniform bool _Use_Global_Right_Index_;\nuniform vec4 Global_Left_Index_Tip_Position;\nuniform vec4 Global_Right_Index_Tip_Position;\nvarying vec3 vPosition;\nvarying vec3 vNormal;\nvarying vec2 vUV;\nvarying vec3 vTangent;\nvarying vec3 vBinormal;\nvarying vec4 vColor;\nvarying vec4 vExtra1;\nvarying vec4 vExtra2;\nvarying vec4 vExtra3;\nvoid Object_To_World_Pos_B115(\nvec3 Pos_Object,\nout vec3 Pos_World)\n{\nPos_World=(world*vec4(Pos_Object,1.0)).xyz;\n}\nvoid PickDir_B140(\nfloat Degrees,\nvec3 DirX,\nvec3 DirY,\nout vec3 Dir)\n{\nfloat a=Degrees*3.14159/180.0;\nDir=cos(a)*DirX+sin(a)*DirY;\n}\nvoid Round_Rect_Vertex_B139(\nvec2 UV,\nfloat Radius,\nfloat Margin,\nfloat Anisotropy,\nfloat Gradient1,\nfloat Gradient2,\nout vec2 Rect_UV,\nout vec4 Rect_Parms,\nout vec2 Scale_XY,\nout vec2 Line_UV)\n{\nScale_XY=vec2(Anisotropy,1.0);\nLine_UV=(UV-vec2(0.5,0.5));\nRect_UV=Line_UV*Scale_XY;\nRect_Parms.xy=Scale_XY*0.5-vec2(Radius,Radius)-vec2(Margin,Margin);\nRect_Parms.z=Gradient1; \nRect_Parms.w=Gradient2;\n}\nvoid Line_Vertex_B135(\nvec2 Scale_XY,\nvec2 UV,\nfloat Time,\nfloat Rate,\nvec4 Highlight_Transform,\nout vec3 Line_Vertex)\n{\nfloat angle2=(Rate*Time)*2.0*3.1416;\nfloat sinAngle2=sin(angle2);\nfloat cosAngle2=cos(angle2);\nvec2 xformUV=UV*Highlight_Transform.xy+Highlight_Transform.zw;\nLine_Vertex.x=0.0;\nLine_Vertex.y=cosAngle2*xformUV.x-sinAngle2*xformUV.y;\nLine_Vertex.z=0.0; \n}\nvoid Blob_Vertex_B180(\nvec3 Position,\nvec3 Normal,\nvec3 Tangent,\nvec3 Bitangent,\nvec3 Blob_Position,\nfloat Intensity,\nfloat Blob_Near_Size,\nfloat Blob_Far_Size,\nfloat Blob_Near_Distance,\nfloat Blob_Far_Distance,\nfloat Blob_Fade_Length,\nfloat Blob_Pulse,\nfloat Blob_Fade,\nout vec4 Blob_Info)\n{\nvec3 blob=Blob_Position;\nvec3 delta=blob-Position;\nfloat dist=dot(Normal,delta);\nfloat lerpValue=clamp((abs(dist)-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);\nfloat fadeValue=1.0-clamp((abs(dist)-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);\nfloat size=Blob_Near_Size+(Blob_Far_Size-Blob_Near_Size)*lerpValue;\nvec2 blobXY=vec2(dot(delta,Tangent),dot(delta,Bitangent))/(0.0001+size);\nfloat Fade=fadeValue*Intensity*Blob_Fade;\nfloat Distance=(lerpValue*0.5+0.5)*(1.0-Blob_Pulse);\nBlob_Info=vec4(blobXY.x,blobXY.y,Distance,Fade);\n}\nvoid Move_Verts_B129(\nfloat Anisotropy,\nvec3 P,\nfloat Radius,\nout vec3 New_P,\nout vec2 New_UV,\nout float Radial_Gradient,\nout vec3 Radial_Dir)\n{\nvec2 UV=P.xy*2.0+0.5;\nvec2 center=clamp(UV,0.0,1.0);\nvec2 delta=UV-center;\nvec2 r2=2.0*vec2(Radius/Anisotropy,Radius);\nNew_UV=center+r2*(UV-2.0*center+0.5);\nNew_P=vec3(New_UV-0.5,P.z);\nRadial_Gradient=1.0-length(delta)*2.0;\nRadial_Dir=vec3(delta*r2,0.0);\n}\nvoid Object_To_World_Dir_B132(\nvec3 Dir_Object,\nout vec3 Binormal_World,\nout vec3 Binormal_World_N,\nout float Binormal_Length)\n{\nBinormal_World=(world*vec4(Dir_Object,0.0)).xyz;\nBinormal_Length=length(Binormal_World);\nBinormal_World_N=Binormal_World/Binormal_Length;\n}\nvoid RelativeOrAbsoluteDetail_B147(\nfloat Nominal_Radius,\nfloat Nominal_LineWidth,\nbool Absolute_Measurements,\nfloat Height,\nout float Radius,\nout float Line_Width)\n{\nfloat scale=Absolute_Measurements ? 1.0/Height : 1.0;\nRadius=Nominal_Radius*scale;\nLine_Width=Nominal_LineWidth*scale;\n}\nvoid Edge_AA_Vertex_B130(\nvec3 Position_World,\nvec3 Position_Object,\nvec3 Normal_Object,\nvec3 Eye,\nfloat Radial_Gradient,\nvec3 Radial_Dir,\nvec3 Tangent,\nout float Gradient1,\nout float Gradient2)\n{\nvec3 I=(Eye-Position_World);\nvec3 T=(world* vec4(Tangent,0.0)).xyz;\nfloat g=(dot(T,I)<0.0) ? 0.0 : 1.0;\nif (Normal_Object.z==0.0) { \nGradient1=Position_Object.z>0.0 ? g : 1.0;\nGradient2=Position_Object.z>0.0 ? 1.0 : g;\n} else {\nGradient1=g+(1.0-g)*(Radial_Gradient);\nGradient2=1.0;\n}\n}\nvoid Pick_Radius_B144(\nfloat Radius,\nfloat Radius_Top_Left,\nfloat Radius_Top_Right,\nfloat Radius_Bottom_Left,\nfloat Radius_Bottom_Right,\nvec3 Position,\nout float Result)\n{\nbool whichY=Position.y>0.0;\nResult=Position.x<0.0 ? (whichY ? Radius_Top_Left : Radius_Bottom_Left) : (whichY ? Radius_Top_Right : Radius_Bottom_Right);\nResult*=Radius;\n}\nvoid main()\n{\nvec3 Nrm_World_Q128;\nNrm_World_Q128=normalize((world*vec4(normal,0.0)).xyz);\nvec3 Tangent_World_Q131;\nvec3 Tangent_World_N_Q131;\nfloat Tangent_Length_Q131;\nTangent_World_Q131=(world*vec4(vec3(1,0,0),0.0)).xyz;\nTangent_Length_Q131=length(Tangent_World_Q131);\nTangent_World_N_Q131=Tangent_World_Q131/Tangent_Length_Q131;\nvec3 Binormal_World_Q132;\nvec3 Binormal_World_N_Q132;\nfloat Binormal_Length_Q132;\nObject_To_World_Dir_B132(vec3(0,1,0),Binormal_World_Q132,Binormal_World_N_Q132,Binormal_Length_Q132);\nfloat Anisotropy_Q133=Tangent_Length_Q131/Binormal_Length_Q132;\nvec3 Result_Q177;\nResult_Q177=mix(_Blob_Position_,Global_Left_Index_Tip_Position.xyz,float(_Use_Global_Left_Index_));\nvec3 Result_Q178;\nResult_Q178=mix(_Blob_Position_2_,Global_Right_Index_Tip_Position.xyz,float(_Use_Global_Right_Index_));\nfloat Result_Q144;\nPick_Radius_B144(_Radius_,_Radius_Top_Left_,_Radius_Top_Right_,_Radius_Bottom_Left_,_Radius_Bottom_Right_,position,Result_Q144);\nvec3 Dir_Q140;\nPickDir_B140(_Angle_,Tangent_World_N_Q131,Binormal_World_N_Q132,Dir_Q140);\nfloat Radius_Q147;\nfloat Line_Width_Q147;\nRelativeOrAbsoluteDetail_B147(Result_Q144,_Line_Width_,_Absolute_Sizes_,Binormal_Length_Q132,Radius_Q147,Line_Width_Q147);\nvec4 Out_Color_Q145=vec4(Radius_Q147,Line_Width_Q147,0,1);\nvec3 New_P_Q129;\nvec2 New_UV_Q129;\nfloat Radial_Gradient_Q129;\nvec3 Radial_Dir_Q129;\nMove_Verts_B129(Anisotropy_Q133,position,Radius_Q147,New_P_Q129,New_UV_Q129,Radial_Gradient_Q129,Radial_Dir_Q129);\nvec3 Pos_World_Q115;\nObject_To_World_Pos_B115(New_P_Q129,Pos_World_Q115);\nvec4 Blob_Info_Q180;\n#if BLOB_ENABLE\nBlob_Vertex_B180(Pos_World_Q115,Nrm_World_Q128,Tangent_World_N_Q131,Binormal_World_N_Q132,Result_Q177,_Blob_Intensity_,_Blob_Near_Size_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_,_Blob_Fade_,Blob_Info_Q180);\n#else\nBlob_Info_Q180=vec4(0,0,0,0);\n#endif\nvec4 Blob_Info_Q181;\n#if BLOB_ENABLE_2\nBlob_Vertex_B180(Pos_World_Q115,Nrm_World_Q128,Tangent_World_N_Q131,Binormal_World_N_Q132,Result_Q178,_Blob_Intensity_,_Blob_Near_Size_2_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_2_,_Blob_Fade_2_,Blob_Info_Q181);\n#else\nBlob_Info_Q181=vec4(0,0,0,0);\n#endif\nfloat Gradient1_Q130;\nfloat Gradient2_Q130;\n#if SMOOTH_EDGES\nEdge_AA_Vertex_B130(Pos_World_Q115,position,normal,cameraPosition,Radial_Gradient_Q129,Radial_Dir_Q129,tangent,Gradient1_Q130,Gradient2_Q130);\n#else\nGradient1_Q130=1.0;\nGradient2_Q130=1.0;\n#endif\nvec2 Rect_UV_Q139;\nvec4 Rect_Parms_Q139;\nvec2 Scale_XY_Q139;\nvec2 Line_UV_Q139;\nRound_Rect_Vertex_B139(New_UV_Q129,Radius_Q147,0.0,Anisotropy_Q133,Gradient1_Q130,Gradient2_Q130,Rect_UV_Q139,Rect_Parms_Q139,Scale_XY_Q139,Line_UV_Q139);\nvec3 Line_Vertex_Q135;\nLine_Vertex_B135(Scale_XY_Q139,Line_UV_Q139,0.0,_Rate_,_Highlight_Transform_,Line_Vertex_Q135);\nvec3 Position=Pos_World_Q115;\nvec3 Normal=Dir_Q140;\nvec2 UV=Rect_UV_Q139;\nvec3 Tangent=Line_Vertex_Q135;\nvec3 Binormal=Nrm_World_Q128;\nvec4 Color=Out_Color_Q145;\nvec4 Extra1=Rect_Parms_Q139;\nvec4 Extra2=Blob_Info_Q180;\nvec4 Extra3=Blob_Info_Q181;\ngl_Position=viewProjection*vec4(Position,1);\nvPosition=Position;\nvNormal=Normal;\nvUV=UV;\nvTangent=Tangent;\nvBinormal=Binormal;\nvColor=Color;\nvExtra1=Extra1;\nvExtra2=Extra2;\nvExtra3=Extra3;\n}";
// Sideeffect
core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__.ShaderStore.ShadersStore[name] = shader;
/** @hidden */
var fluentBackplateVertexShader = { name: name, shader: shader };


/***/ }),

/***/ "../../../lts/gui/dist/3D/materials/fluentButton/fluentButtonMaterial.js":
/*!*******************************************************************************!*\
  !*** ../../../lts/gui/dist/3D/materials/fluentButton/fluentButtonMaterial.js ***!
  \*******************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "FluentButtonMaterial": () => (/* binding */ FluentButtonMaterial)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Engines/constants */ "core/Misc/observable");
/* harmony import */ var core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _shaders_fluentButton_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./shaders/fluentButton.fragment */ "../../../lts/gui/dist/3D/materials/fluentButton/shaders/fluentButton.fragment.js");
/* harmony import */ var _shaders_fluentButton_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./shaders/fluentButton.vertex */ "../../../lts/gui/dist/3D/materials/fluentButton/shaders/fluentButton.vertex.js");














/** @hidden */
var FluentButtonMaterialDefines = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(FluentButtonMaterialDefines, _super);
    function FluentButtonMaterialDefines() {
        var _this = _super.call(this) || this;
        _this.RELATIVE_WIDTH = true;
        _this.ENABLE_FADE = true;
        _this._needNormals = true;
        _this._needUVs = true;
        _this.rebuild();
        return _this;
    }
    return FluentButtonMaterialDefines;
}(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.MaterialDefines));
/**
 * Class used to render square buttons with fluent design
 * @since 5.0.0
 */
var FluentButtonMaterial = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(FluentButtonMaterial, _super);
    function FluentButtonMaterial(name, scene) {
        var _this = _super.call(this, name, scene) || this;
        /**
         * Gets or sets the width of the glowing edge, relative to the scale of the button.
         * (Default is 4% of the height).
         */
        _this.edgeWidth = 0.04;
        /**
         * Gets or sets the color of the glowing edge.
         */
        _this.edgeColor = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Color4(0.592157, 0.592157, 0.592157, 1.0);
        /**
         * Gets or sets the maximum intensity of the proximity light.
         */
        _this.proximityMaxIntensity = 0.45;
        /**
         * Gets or sets the maximum distance for the proximity light (Default is 16mm).
         */
        _this.proximityFarDistance = 0.16;
        /**
         * Gets or sets the radius of the proximity light when near to the surface.
         */
        _this.proximityNearRadius = 1.5;
        /**
         * Gets or sets the anisotropy of the proximity light.
         */
        _this.proximityAnisotropy = 1;
        /**
         * Gets or sets the amount of fuzzing in the selection focus.
         */
        _this.selectionFuzz = 0.5;
        /**
         * Gets or sets an override value to display the button as selected.
         */
        _this.selected = 0;
        /**
         * Gets or sets a value to manually fade the blob size.
         */
        _this.selectionFade = 0;
        /**
         * Gets or sets a value to manually shrink the blob size as it fades (see selectionFade).
         */
        _this.selectionFadeSize = 0.3;
        /**
         * Gets or sets the distance from the button the cursor should be for the button
         * to appear selected (Default is 8cm).
         */
        _this.selectedDistance = 0.08;
        /**
         * Gets or sets the fall-off distance for the selection fade (Default is 8cm).
         */
        _this.selectedFadeLength = 0.08;
        /**
         * Gets or sets the intensity of the luminous blob (Ranges 0-1, default is 0.5).
         */
        _this.blobIntensity = 0.5;
        /**
         * The size of the blob when the pointer is at the blobFarDistance (Default is 5cm).
         */
        _this.blobFarSize = 0.05;
        /**
         * The distance at which the pointer is considered near. See [left|right]BlobNearSize. (Default is 0cm).
         */
        _this.blobNearDistance = 0;
        /**
         * The distance at which the pointer is considered far. See [left|right]BlobFarSize. (Default is 8cm).
         */
        _this.blobFarDistance = 0.08;
        /**
         * The distance over which the blob intensity fades from full to none (Default is 8cm).
         */
        _this.blobFadeLength = 0.08;
        /**
         * Gets or sets whether the blob corresponding to the left index finger is enabled.
         */
        _this.leftBlobEnable = true;
        /**
         * Gets or sets the size of the left blob when the left pointer is considered near. See blobNearDistance. (Default is 2.5cm).
         */
        _this.leftBlobNearSize = 0.025;
        /**
         * Gets or sets the progress of the pulse animation on the left blob (Ranges 0-1).
         */
        _this.leftBlobPulse = 0;
        /**
         * Gets or sets the fade factor on the left blob.
         */
        _this.leftBlobFade = 1;
        /**
         * Gets or sets the inner fade on the left blob;
         */
        _this.leftBlobInnerFade = 0.01;
        /**
         * Gets or sets whether the blob corresponding to the right index finger is enabled.
         */
        _this.rightBlobEnable = true;
        /**
         * Gets or sets the size of the right blob when the right pointer is considered near. See blobNearDistance. (Default is 2.5cm).
         */
        _this.rightBlobNearSize = 0.025;
        /**
         * Gets or sets the progress of the pulse animation on the right blob (Ranges 0-1).
         */
        _this.rightBlobPulse = 0;
        /**
         * Gets or sets the fade factor on the right blob.
         */
        _this.rightBlobFade = 1;
        /**
         * Gets or sets the inner fade on the right blob;
         */
        _this.rightBlobInnerFade = 0.01;
        /**
         * Gets or sets the direction of the active face before the world transform is applied.
         * This should almost always be set to -z.
         */
        _this.activeFaceDir = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector3(0, 0, -1);
        /**
         * Gets or sets the button's up direction before the world transform is applied.
         * This should almost always be set to +y.
         */
        _this.activeFaceUp = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector3(0, 1, 0);
        /**
         * Gets or sets whether the edge fade effect is enabled.
         */
        _this.enableFade = true;
        /**
         * Gets or sets a value corresponding to the width of the edge fade effect (Default 1.5).
         */
        _this.fadeWidth = 1.5;
        /**
         * Gets or sets whether the active face is smoothly interpolated.
         */
        _this.smoothActiveFace = true;
        /**
         * Gets or sets whether the frame of the fluent button model is visible.
         * This is usually only enabled for debugging purposes.
         */
        _this.showFrame = false;
        /**
         * Gets or sets whether the blob color texture is used for the proximity
         * light effect. This is usually only disabled for debugging purposes.
         */
        _this.useBlobTexture = true;
        /**
         * Gets or sets the world-space position of the tip of the left index finger.
         */
        _this.globalLeftIndexTipPosition = core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector3.Zero();
        /**
         * Gets or sets the world-space position of the tip of the right index finger.
         */
        _this.globalRightIndexTipPosition = core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector3.Zero();
        _this.alphaMode = core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Constants.ALPHA_ADD;
        _this.disableDepthWrite = true;
        _this.backFaceCulling = false;
        _this._blobTexture = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Texture(FluentButtonMaterial.BLOB_TEXTURE_URL, _this.getScene(), true, false, core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Texture.NEAREST_SAMPLINGMODE);
        return _this;
    }
    FluentButtonMaterial.prototype.needAlphaBlending = function () {
        return true;
    };
    FluentButtonMaterial.prototype.needAlphaTesting = function () {
        return true;
    };
    FluentButtonMaterial.prototype.getAlphaTestTexture = function () {
        return null;
    };
    // Methods
    FluentButtonMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh) {
        if (this.isFrozen) {
            if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {
                return true;
            }
        }
        if (!subMesh.materialDefines) {
            subMesh.materialDefines = new FluentButtonMaterialDefines();
        }
        var defines = subMesh.materialDefines;
        var scene = this.getScene();
        if (this._isReadyForSubMesh(subMesh)) {
            return true;
        }
        var engine = scene.getEngine();
        // Attribs
        core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, false);
        // Get correct effect
        if (defines.isDirty) {
            defines.markAsProcessed();
            scene.resetCachedMaterial();
            // Fallbacks
            var fallbacks = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.EffectFallbacks();
            if (defines.FOG) {
                fallbacks.addFallback(1, "FOG");
            }
            core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.MaterialHelper.HandleFallbacksForShadows(defines, fallbacks);
            defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;
            //Attributes
            var attribs = [core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.VertexBuffer.PositionKind];
            if (defines.NORMAL) {
                attribs.push(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.VertexBuffer.NormalKind);
            }
            if (defines.UV1) {
                attribs.push(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.VertexBuffer.UVKind);
            }
            if (defines.UV2) {
                attribs.push(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.VertexBuffer.UV2Kind);
            }
            if (defines.VERTEXCOLOR) {
                attribs.push(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.VertexBuffer.ColorKind);
            }
            if (defines.TANGENT) {
                attribs.push(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.VertexBuffer.TangentKind);
            }
            core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.MaterialHelper.PrepareAttributesForInstances(attribs, defines);
            // Legacy browser patch
            var shaderName = "fluentButton";
            var join = defines.toString();
            var uniforms = [
                "world",
                "viewProjection",
                "cameraPosition",
                "_Edge_Width_",
                "_Edge_Color_",
                "_Relative_Width_",
                "_Proximity_Max_Intensity_",
                "_Proximity_Far_Distance_",
                "_Proximity_Near_Radius_",
                "_Proximity_Anisotropy_",
                "_Selection_Fuzz_",
                "_Selected_",
                "_Selection_Fade_",
                "_Selection_Fade_Size_",
                "_Selected_Distance_",
                "_Selected_Fade_Length_",
                "_Blob_Enable_",
                "_Blob_Position_",
                "_Blob_Intensity_",
                "_Blob_Near_Size_",
                "_Blob_Far_Size_",
                "_Blob_Near_Distance_",
                "_Blob_Far_Distance_",
                "_Blob_Fade_Length_",
                "_Blob_Inner_Fade_",
                "_Blob_Pulse_",
                "_Blob_Fade_",
                "_Blob_Texture_",
                "_Blob_Enable_2_",
                "_Blob_Position_2_",
                "_Blob_Near_Size_2_",
                "_Blob_Inner_Fade_2_",
                "_Blob_Pulse_2_",
                "_Blob_Fade_2_",
                "_Active_Face_Dir_",
                "_Active_Face_Up_",
                "_Enable_Fade_",
                "_Fade_Width_",
                "_Smooth_Active_Face_",
                "_Show_Frame_",
                "_Use_Blob_Texture_",
                "Use_Global_Left_Index",
                "Use_Global_Right_Index",
                "Global_Left_Index_Tip_Position",
                "Global_Right_Index_Tip_Position",
                "Global_Left_Thumb_Tip_Position",
                "Global_Right_Thumb_Tip_Position",
                "Global_Left_Index_Tip_Proximity",
                "Global_Right_Index_Tip_Proximity",
            ];
            var samplers = ["_Blob_Texture_"];
            var uniformBuffers = new Array();
            core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.MaterialHelper.PrepareUniformsAndSamplersList({
                uniformsNames: uniforms,
                uniformBuffersNames: uniformBuffers,
                samplers: samplers,
                defines: defines,
                maxSimultaneousLights: 4,
            });
            subMesh.setEffect(scene.getEngine().createEffect(shaderName, {
                attributes: attribs,
                uniformsNames: uniforms,
                uniformBuffersNames: uniformBuffers,
                samplers: samplers,
                defines: join,
                fallbacks: fallbacks,
                onCompiled: this.onCompiled,
                onError: this.onError,
                indexParameters: { maxSimultaneousLights: 4 },
            }, engine), defines, this._materialContext);
        }
        if (!subMesh.effect || !subMesh.effect.isReady()) {
            return false;
        }
        defines._renderId = scene.getRenderId();
        subMesh.effect._wasPreviouslyReady = true;
        return true;
    };
    FluentButtonMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) {
        var scene = this.getScene();
        var defines = subMesh.materialDefines;
        if (!defines) {
            return;
        }
        var effect = subMesh.effect;
        if (!effect) {
            return;
        }
        this._activeEffect = effect;
        // Matrices
        this.bindOnlyWorldMatrix(world);
        this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
        this._activeEffect.setVector3("cameraPosition", scene.activeCamera.position);
        // "Blob Texture"
        this._activeEffect.setTexture("_Blob_Texture_", this._blobTexture);
        // "Wireframe"
        this._activeEffect.setFloat("_Edge_Width_", this.edgeWidth);
        this._activeEffect.setColor4("_Edge_Color_", new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Color3(this.edgeColor.r, this.edgeColor.g, this.edgeColor.b), this.edgeColor.a);
        //define _Relative_Width_ true;
        // "Proximity"
        this._activeEffect.setFloat("_Proximity_Max_Intensity_", this.proximityMaxIntensity);
        this._activeEffect.setFloat("_Proximity_Far_Distance_", this.proximityFarDistance);
        this._activeEffect.setFloat("_Proximity_Near_Radius_", this.proximityNearRadius);
        this._activeEffect.setFloat("_Proximity_Anisotropy_", this.proximityAnisotropy);
        // "Selection"
        this._activeEffect.setFloat("_Selection_Fuzz_", this.selectionFuzz);
        this._activeEffect.setFloat("_Selected_", this.selected);
        this._activeEffect.setFloat("_Selection_Fade_", this.selectionFade);
        this._activeEffect.setFloat("_Selection_Fade_Size_", this.selectionFadeSize);
        this._activeEffect.setFloat("_Selected_Distance_", this.selectedDistance);
        this._activeEffect.setFloat("_Selected_Fade_Length_", this.selectedFadeLength);
        // "Blob"
        this._activeEffect.setFloat("_Blob_Enable_", this.leftBlobEnable ? 1.0 : 0.0);
        this._activeEffect.setFloat("_Blob_Intensity_", this.blobIntensity);
        this._activeEffect.setFloat("_Blob_Near_Size_", this.leftBlobNearSize);
        this._activeEffect.setFloat("_Blob_Far_Size_", this.blobFarSize);
        this._activeEffect.setFloat("_Blob_Near_Distance_", this.blobNearDistance);
        this._activeEffect.setFloat("_Blob_Far_Distance_", this.blobFarDistance);
        this._activeEffect.setFloat("_Blob_Fade_Length_", this.blobFadeLength);
        this._activeEffect.setFloat("_Blob_Inner_Fade_", this.leftBlobInnerFade);
        this._activeEffect.setFloat("_Blob_Pulse_", this.leftBlobPulse);
        this._activeEffect.setFloat("_Blob_Fade_", this.leftBlobFade);
        // "Blob 2"
        this._activeEffect.setFloat("_Blob_Enable_2_", this.rightBlobEnable ? 1.0 : 0.0);
        this._activeEffect.setFloat("_Blob_Near_Size_2_", this.rightBlobNearSize);
        this._activeEffect.setFloat("_Blob_Inner_Fade_2_", this.rightBlobInnerFade);
        this._activeEffect.setFloat("_Blob_Pulse_2_", this.rightBlobPulse);
        this._activeEffect.setFloat("_Blob_Fade_2_", this.rightBlobFade);
        // "Active Face"
        this._activeEffect.setVector3("_Active_Face_Dir_", this.activeFaceDir);
        this._activeEffect.setVector3("_Active_Face_Up_", this.activeFaceUp);
        // "Hololens Edge Fade"
        //define _Enable_Fade_ true;
        this._activeEffect.setFloat("_Fade_Width_", this.fadeWidth);
        this._activeEffect.setFloat("_Smooth_Active_Face_", this.smoothActiveFace ? 1.0 : 0.0);
        // "Debug"
        this._activeEffect.setFloat("_Show_Frame_", this.showFrame ? 1.0 : 0.0);
        this._activeEffect.setFloat("_Use_Blob_Texture_", this.useBlobTexture ? 1.0 : 0.0);
        // Global inputs
        this._activeEffect.setFloat("Use_Global_Left_Index", 1.0);
        this._activeEffect.setFloat("Use_Global_Right_Index", 1.0);
        this._activeEffect.setVector4("Global_Left_Index_Tip_Position", new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector4(this.globalLeftIndexTipPosition.x, this.globalLeftIndexTipPosition.y, this.globalLeftIndexTipPosition.z, 1.0));
        this._activeEffect.setVector4("Global_Right_Index_Tip_Position", new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector4(this.globalRightIndexTipPosition.x, this.globalRightIndexTipPosition.y, this.globalRightIndexTipPosition.z, 1.0));
        this._afterBind(mesh, this._activeEffect);
    };
    /**
     * Get the list of animatables in the material.
     * @returns the list of animatables object used in the material
     */
    FluentButtonMaterial.prototype.getAnimatables = function () {
        return [];
    };
    FluentButtonMaterial.prototype.dispose = function (forceDisposeEffect) {
        _super.prototype.dispose.call(this, forceDisposeEffect);
    };
    FluentButtonMaterial.prototype.clone = function (name) {
        var _this = this;
        return core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.SerializationHelper.Clone(function () { return new FluentButtonMaterial(name, _this.getScene()); }, this);
    };
    FluentButtonMaterial.prototype.serialize = function () {
        var serializationObject = _super.prototype.serialize.call(this);
        serializationObject.customType = "BABYLON.FluentButtonMaterial";
        return serializationObject;
    };
    FluentButtonMaterial.prototype.getClassName = function () {
        return "FluentButtonMaterial";
    };
    // Statics
    FluentButtonMaterial.Parse = function (source, scene, rootUrl) {
        return core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.SerializationHelper.Parse(function () { return new FluentButtonMaterial(source.name, scene); }, source, scene, rootUrl);
    };
    /**
     * URL pointing to the texture used to define the coloring for the fluent blob effect.
     */
    FluentButtonMaterial.BLOB_TEXTURE_URL = "https://assets.babylonjs.com/meshes/MRTK/mrtk-fluent-button-blob.png";
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentButtonMaterial.prototype, "edgeWidth", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serializeAsColor4)()
    ], FluentButtonMaterial.prototype, "edgeColor", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentButtonMaterial.prototype, "proximityMaxIntensity", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentButtonMaterial.prototype, "proximityFarDistance", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentButtonMaterial.prototype, "proximityNearRadius", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentButtonMaterial.prototype, "proximityAnisotropy", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentButtonMaterial.prototype, "selectionFuzz", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentButtonMaterial.prototype, "selected", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentButtonMaterial.prototype, "selectionFade", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentButtonMaterial.prototype, "selectionFadeSize", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentButtonMaterial.prototype, "selectedDistance", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentButtonMaterial.prototype, "selectedFadeLength", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentButtonMaterial.prototype, "blobIntensity", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentButtonMaterial.prototype, "blobFarSize", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentButtonMaterial.prototype, "blobNearDistance", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentButtonMaterial.prototype, "blobFarDistance", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentButtonMaterial.prototype, "blobFadeLength", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentButtonMaterial.prototype, "leftBlobEnable", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentButtonMaterial.prototype, "leftBlobNearSize", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentButtonMaterial.prototype, "leftBlobPulse", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentButtonMaterial.prototype, "leftBlobFade", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentButtonMaterial.prototype, "leftBlobInnerFade", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentButtonMaterial.prototype, "rightBlobEnable", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentButtonMaterial.prototype, "rightBlobNearSize", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentButtonMaterial.prototype, "rightBlobPulse", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentButtonMaterial.prototype, "rightBlobFade", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentButtonMaterial.prototype, "rightBlobInnerFade", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serializeAsVector3)()
    ], FluentButtonMaterial.prototype, "activeFaceDir", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serializeAsVector3)()
    ], FluentButtonMaterial.prototype, "activeFaceUp", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentButtonMaterial.prototype, "enableFade", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentButtonMaterial.prototype, "fadeWidth", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentButtonMaterial.prototype, "smoothActiveFace", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentButtonMaterial.prototype, "showFrame", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], FluentButtonMaterial.prototype, "useBlobTexture", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serializeAsVector3)()
    ], FluentButtonMaterial.prototype, "globalLeftIndexTipPosition", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serializeAsVector3)()
    ], FluentButtonMaterial.prototype, "globalRightIndexTipPosition", void 0);
    return FluentButtonMaterial;
}(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.PushMaterial));

(0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.RegisterClass)("BABYLON.GUI.FluentButtonMaterial", FluentButtonMaterial);


/***/ }),

/***/ "../../../lts/gui/dist/3D/materials/fluentButton/index.js":
/*!****************************************************************!*\
  !*** ../../../lts/gui/dist/3D/materials/fluentButton/index.js ***!
  \****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "FluentButtonMaterial": () => (/* reexport safe */ _fluentButtonMaterial__WEBPACK_IMPORTED_MODULE_0__.FluentButtonMaterial)
/* harmony export */ });
/* harmony import */ var _fluentButtonMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./fluentButtonMaterial */ "../../../lts/gui/dist/3D/materials/fluentButton/fluentButtonMaterial.js");



/***/ }),

/***/ "../../../lts/gui/dist/3D/materials/fluentButton/shaders/fluentButton.fragment.js":
/*!****************************************************************************************!*\
  !*** ../../../lts/gui/dist/3D/materials/fluentButton/shaders/fluentButton.fragment.js ***!
  \****************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "fluentButtonPixelShader": () => (/* binding */ fluentButtonPixelShader)
/* harmony export */ });
/* harmony import */ var core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Engines/shaderStore */ "core/Misc/observable");
/* harmony import */ var core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);
// Do not edit.

var name = "fluentButtonPixelShader";
var shader = "uniform vec3 cameraPosition;\nvarying vec3 vPosition;\nvarying vec3 vNormal;\nvarying vec2 vUV;\nvarying vec3 vTangent;\nvarying vec3 vBinormal;\nvarying vec4 vColor;\nvarying vec4 vExtra1;\nuniform float _Edge_Width_;\nuniform vec4 _Edge_Color_;\nuniform bool _Relative_Width_;\nuniform float _Proximity_Max_Intensity_;\nuniform float _Proximity_Far_Distance_;\nuniform float _Proximity_Near_Radius_;\nuniform float _Proximity_Anisotropy_;\nuniform float _Selection_Fuzz_;\nuniform float _Selected_;\nuniform float _Selection_Fade_;\nuniform float _Selection_Fade_Size_;\nuniform float _Selected_Distance_;\nuniform float _Selected_Fade_Length_;\nuniform bool _Blob_Enable_;\nuniform vec3 _Blob_Position_;\nuniform float _Blob_Intensity_;\nuniform float _Blob_Near_Size_;\nuniform float _Blob_Far_Size_;\nuniform float _Blob_Near_Distance_;\nuniform float _Blob_Far_Distance_;\nuniform float _Blob_Fade_Length_;\nuniform float _Blob_Inner_Fade_;\nuniform float _Blob_Pulse_;\nuniform float _Blob_Fade_;\nuniform sampler2D _Blob_Texture_;\nuniform bool _Blob_Enable_2_;\nuniform vec3 _Blob_Position_2_;\nuniform float _Blob_Near_Size_2_;\nuniform float _Blob_Inner_Fade_2_;\nuniform float _Blob_Pulse_2_;\nuniform float _Blob_Fade_2_;\nuniform vec3 _Active_Face_Dir_;\nuniform vec3 _Active_Face_Up_;\nuniform bool Enable_Fade;\nuniform float _Fade_Width_;\nuniform bool _Smooth_Active_Face_;\nuniform bool _Show_Frame_;\nuniform bool _Use_Blob_Texture_;\nuniform bool Use_Global_Left_Index;\nuniform bool Use_Global_Right_Index;\nuniform vec4 Global_Left_Index_Tip_Position;\nuniform vec4 Global_Right_Index_Tip_Position;\nuniform vec4 Global_Left_Thumb_Tip_Position;\nuniform vec4 Global_Right_Thumb_Tip_Position;\nuniform float Global_Left_Index_Tip_Proximity;\nuniform float Global_Right_Index_Tip_Proximity;\nvoid Holo_Edge_Fragment_B35(\nvec4 Edges,\nfloat Edge_Width,\nout float NotEdge)\n{\nvec2 c=vec2(min(Edges.r,Edges.g),min(Edges.b,Edges.a));\nvec2 df=fwidth(c)*Edge_Width;\nvec2 g=clamp(c/df,0.0,1.0);\nNotEdge=g.x*g.y;\n}\nvoid Blob_Fragment_B39(\nvec2 UV,\nvec3 Blob_Info,\nsampler2D Blob_Texture,\nout vec4 Blob_Color)\n{\nfloat k=dot(UV,UV);\nBlob_Color=Blob_Info.y*texture(Blob_Texture,vec2(vec2(sqrt(k),Blob_Info.x).x,1.0-vec2(sqrt(k),Blob_Info.x).y))*(1.0-clamp(k,0.0,1.0));\n}\nvec2 FilterStep(vec2 Edge,vec2 X)\n{\nvec2 dX=max(fwidth(X),vec2(0.00001,0.00001));\nreturn clamp( (X+dX-max(Edge,X-dX))/(dX*2.0),0.0,1.0);\n}\nvoid Wireframe_Fragment_B59(\nvec3 Widths,\nvec2 UV,\nfloat Proximity,\nvec4 Edge_Color,\nout vec4 Wireframe)\n{\nvec2 c=min(UV,vec2(1.0,1.0)-UV);\nvec2 g=FilterStep(Widths.xy*0.5,c); \nWireframe=(1.0-min(g.x,g.y))*Proximity*Edge_Color;\n}\nvoid Proximity_B53(\nvec3 Proximity_Center,\nvec3 Proximity_Center_2,\nfloat Proximity_Max_Intensity,\nfloat Proximity_Near_Radius,\nvec3 Position,\nvec3 Show_Selection,\nvec4 Extra1,\nfloat Dist_To_Face,\nfloat Intensity,\nout float Proximity)\n{\nvec2 delta1=Extra1.xy;\nvec2 delta2=Extra1.zw;\nfloat d2=sqrt(min(dot(delta1,delta1),dot(delta2,delta2))+Dist_To_Face*Dist_To_Face);\nProximity=Intensity*Proximity_Max_Intensity*(1.0-clamp(d2/Proximity_Near_Radius,0.0,1.0))*(1.0-Show_Selection.x)+Show_Selection.x;\n}\nvoid To_XYZ_B46(\nvec3 Vec3,\nout float X,\nout float Y,\nout float Z)\n{\nX=Vec3.x;\nY=Vec3.y;\nZ=Vec3.z;\n}\nvoid main()\n{\nfloat NotEdge_Q35;\n#if ENABLE_FADE\nHolo_Edge_Fragment_B35(vColor,_Fade_Width_,NotEdge_Q35);\n#else\nNotEdge_Q35=1.0;\n#endif\nvec4 Blob_Color_Q39;\nfloat k=dot(vUV,vUV);\nvec2 blobTextureCoord=vec2(vec2(sqrt(k),vTangent.x).x,1.0-vec2(sqrt(k),vTangent.x).y);\nvec4 blobColor=mix(vec4(1.0,1.0,1.0,1.0)*step(1.0-vTangent.x,clamp(sqrt(k)+0.1,0.0,1.0)),texture(_Blob_Texture_,blobTextureCoord),float(_Use_Blob_Texture_));\nBlob_Color_Q39=vTangent.y*blobColor*(1.0-clamp(k,0.0,1.0));\nfloat Is_Quad_Q24;\nIs_Quad_Q24=vNormal.z;\nvec3 Blob_Position_Q41= mix(_Blob_Position_,Global_Left_Index_Tip_Position.xyz,float(Use_Global_Left_Index));\nvec3 Blob_Position_Q42= mix(_Blob_Position_2_,Global_Right_Index_Tip_Position.xyz,float(Use_Global_Right_Index));\nfloat X_Q46;\nfloat Y_Q46;\nfloat Z_Q46;\nTo_XYZ_B46(vBinormal,X_Q46,Y_Q46,Z_Q46);\nfloat Proximity_Q53;\nProximity_B53(Blob_Position_Q41,Blob_Position_Q42,_Proximity_Max_Intensity_,_Proximity_Near_Radius_,vPosition,vBinormal,vExtra1,Y_Q46,Z_Q46,Proximity_Q53);\nvec4 Wireframe_Q59;\nWireframe_Fragment_B59(vNormal,vUV,Proximity_Q53,_Edge_Color_,Wireframe_Q59);\nvec4 Wire_Or_Blob_Q23=mix(Wireframe_Q59,Blob_Color_Q39,Is_Quad_Q24);\nvec4 Result_Q22;\nResult_Q22=mix(Wire_Or_Blob_Q23,vec4(0.3,0.3,0.3,0.3),float(_Show_Frame_));\nvec4 Final_Color_Q37=NotEdge_Q35*Result_Q22;\nvec4 Out_Color=Final_Color_Q37;\nfloat Clip_Threshold=0.0;\nbool To_sRGB=false;\ngl_FragColor=Out_Color;\n}";
// Sideeffect
core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__.ShaderStore.ShadersStore[name] = shader;
/** @hidden */
var fluentButtonPixelShader = { name: name, shader: shader };


/***/ }),

/***/ "../../../lts/gui/dist/3D/materials/fluentButton/shaders/fluentButton.vertex.js":
/*!**************************************************************************************!*\
  !*** ../../../lts/gui/dist/3D/materials/fluentButton/shaders/fluentButton.vertex.js ***!
  \**************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "fluentButtonVertexShader": () => (/* binding */ fluentButtonVertexShader)
/* harmony export */ });
/* harmony import */ var core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Engines/shaderStore */ "core/Misc/observable");
/* harmony import */ var core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);
// Do not edit.

var name = "fluentButtonVertexShader";
var shader = "uniform mat4 world;\nuniform mat4 viewProjection;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute vec3 tangent;\nattribute vec4 color;\nuniform float _Edge_Width_;\nuniform vec4 _Edge_Color_;\nuniform float _Proximity_Max_Intensity_;\nuniform float _Proximity_Far_Distance_;\nuniform float _Proximity_Near_Radius_;\nuniform float _Proximity_Anisotropy_;\nuniform float _Selection_Fuzz_;\nuniform float _Selected_;\nuniform float _Selection_Fade_;\nuniform float _Selection_Fade_Size_;\nuniform float _Selected_Distance_;\nuniform float _Selected_Fade_Length_;\nuniform bool _Blob_Enable_;\nuniform vec3 _Blob_Position_;\nuniform float _Blob_Intensity_;\nuniform float _Blob_Near_Size_;\nuniform float _Blob_Far_Size_;\nuniform float _Blob_Near_Distance_;\nuniform float _Blob_Far_Distance_;\nuniform float _Blob_Fade_Length_;\nuniform float _Blob_Inner_Fade_;\nuniform float _Blob_Pulse_;\nuniform float _Blob_Fade_;\nuniform sampler2D _Blob_Texture_;\nuniform bool _Blob_Enable_2_;\nuniform vec3 _Blob_Position_2_;\nuniform float _Blob_Near_Size_2_;\nuniform float _Blob_Inner_Fade_2_;\nuniform float _Blob_Pulse_2_;\nuniform float _Blob_Fade_2_;\nuniform vec3 _Active_Face_Dir_;\nuniform vec3 _Active_Face_Up_;\nuniform bool _Enable_Fade_;\nuniform float _Fade_Width_;\nuniform bool _Smooth_Active_Face_;\nuniform bool _Show_Frame_;\nuniform bool Use_Global_Left_Index;\nuniform bool Use_Global_Right_Index;\nuniform vec4 Global_Left_Index_Tip_Position;\nuniform vec4 Global_Right_Index_Tip_Position;\nuniform vec4 Global_Left_Thumb_Tip_Position;\nuniform vec4 Global_Right_Thumb_Tip_Position;\nuniform float Global_Left_Index_Tip_Proximity;\nuniform float Global_Right_Index_Tip_Proximity;\nvarying vec3 vPosition;\nvarying vec3 vNormal;\nvarying vec2 vUV;\nvarying vec3 vTangent;\nvarying vec3 vBinormal;\nvarying vec4 vColor;\nvarying vec4 vExtra1;\nvoid Blob_Vertex_B47(\nvec3 Position,\nvec3 Normal,\nvec3 Tangent,\nvec3 Bitangent,\nvec3 Blob_Position,\nfloat Intensity,\nfloat Blob_Near_Size,\nfloat Blob_Far_Size,\nfloat Blob_Near_Distance,\nfloat Blob_Far_Distance,\nvec4 Vx_Color,\nvec2 UV,\nvec3 Face_Center,\nvec2 Face_Size,\nvec2 In_UV,\nfloat Blob_Fade_Length,\nfloat Selection_Fade,\nfloat Selection_Fade_Size,\nfloat Inner_Fade,\nvec3 Active_Face_Center,\nfloat Blob_Pulse,\nfloat Blob_Fade,\nfloat Blob_Enabled,\nout vec3 Out_Position,\nout vec2 Out_UV,\nout vec3 Blob_Info)\n{\nfloat blobSize,fadeIn;\nvec3 Hit_Position;\nBlob_Info=vec3(0.0,0.0,0.0);\nfloat Hit_Distance=dot(Blob_Position-Face_Center,Normal);\nHit_Position=Blob_Position-Hit_Distance*Normal;\nfloat absD=abs(Hit_Distance);\nfloat lerpVal=clamp((absD-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);\nfadeIn=1.0-clamp((absD-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);\nfloat innerFade=1.0-clamp(-Hit_Distance/Inner_Fade,0.0,1.0);\nfloat farClip=clamp(1.0-step(Blob_Far_Distance+Blob_Fade_Length,absD),0.0,1.0);\nfloat size=mix(Blob_Near_Size,Blob_Far_Size,lerpVal)*farClip;\nblobSize=mix(size,Selection_Fade_Size,Selection_Fade)*innerFade*Blob_Enabled;\nBlob_Info.x=lerpVal*0.5+0.5;\nBlob_Info.y=fadeIn*Intensity*(1.0-Selection_Fade)*Blob_Fade;\nBlob_Info.x*=(1.0-Blob_Pulse);\nvec3 delta=Hit_Position-Face_Center;\nvec2 blobCenterXY=vec2(dot(delta,Tangent),dot(delta,Bitangent));\nvec2 quadUVin=2.0*UV-1.0; \nvec2 blobXY=blobCenterXY+quadUVin*blobSize;\nvec2 blobClipped=clamp(blobXY,-Face_Size*0.5,Face_Size*0.5);\nvec2 blobUV=(blobClipped-blobCenterXY)/max(blobSize,0.0001)*2.0;\nvec3 blobCorner=Face_Center+blobClipped.x*Tangent+blobClipped.y*Bitangent;\nOut_Position=mix(Position,blobCorner,Vx_Color.rrr);\nOut_UV=mix(In_UV,blobUV,Vx_Color.rr);\n}\nvec2 ProjectProximity(\nvec3 blobPosition,\nvec3 position,\nvec3 center,\nvec3 dir,\nvec3 xdir,\nvec3 ydir,\nout float vdistance\n)\n{\nvec3 delta=blobPosition-position;\nvec2 xy=vec2(dot(delta,xdir),dot(delta,ydir));\nvdistance=abs(dot(delta,dir));\nreturn xy;\n}\nvoid Proximity_Vertex_B66(\nvec3 Blob_Position,\nvec3 Blob_Position_2,\nvec3 Active_Face_Center,\nvec3 Active_Face_Dir,\nvec3 Position,\nfloat Proximity_Far_Distance,\nfloat Relative_Scale,\nfloat Proximity_Anisotropy,\nvec3 Up,\nout vec4 Extra1,\nout float Distance_To_Face,\nout float Intensity)\n{\nvec3 Active_Face_Dir_X=normalize(cross(Active_Face_Dir,Up));\nvec3 Active_Face_Dir_Y=cross(Active_Face_Dir,Active_Face_Dir_X);\nfloat distz1,distz2;\nExtra1.xy=ProjectProximity(Blob_Position,Position,Active_Face_Center,Active_Face_Dir,Active_Face_Dir_X*Proximity_Anisotropy,Active_Face_Dir_Y,distz1)/Relative_Scale;\nExtra1.zw=ProjectProximity(Blob_Position_2,Position,Active_Face_Center,Active_Face_Dir,Active_Face_Dir_X*Proximity_Anisotropy,Active_Face_Dir_Y,distz2)/Relative_Scale;\nDistance_To_Face=dot(Active_Face_Dir,Position-Active_Face_Center);\nIntensity=1.0-clamp(min(distz1,distz2)/Proximity_Far_Distance,0.0,1.0);\n}\nvoid Holo_Edge_Vertex_B44(\nvec3 Incident,\nvec3 Normal,\nvec2 UV,\nvec3 Tangent,\nvec3 Bitangent,\nbool Smooth_Active_Face,\nfloat Active,\nout vec4 Holo_Edges)\n{\nfloat NdotI=dot(Incident,Normal);\nvec2 flip=(UV-vec2(0.5,0.5));\nfloat udot=dot(Incident,Tangent)*flip.x*NdotI;\nfloat uval=1.0-float(udot>0.0);\nfloat vdot=-dot(Incident,Bitangent)*flip.y*NdotI;\nfloat vval=1.0-float(vdot>0.0);\nfloat Smooth_And_Active=step(1.0,float(Smooth_Active_Face && Active>0.0));\nuval=mix(uval,max(1.0,uval),Smooth_And_Active); \nvval=mix(vval,max(1.0,vval),Smooth_And_Active);\nHolo_Edges=vec4(1.0,1.0,1.0,1.0)-vec4(uval*UV.x,uval*(1.0-UV.x),vval*UV.y,vval*(1.0-UV.y));\n}\nvoid Object_To_World_Pos_B13(\nvec3 Pos_Object,\nout vec3 Pos_World)\n{\nPos_World=(world*vec4(Pos_Object,1.0)).xyz;\n}\nvoid Choose_Blob_B38(\nvec4 Vx_Color,\nvec3 Position1,\nvec3 Position2,\nbool Blob_Enable_1,\nbool Blob_Enable_2,\nfloat Near_Size_1,\nfloat Near_Size_2,\nfloat Blob_Inner_Fade_1,\nfloat Blob_Inner_Fade_2,\nfloat Blob_Pulse_1,\nfloat Blob_Pulse_2,\nfloat Blob_Fade_1,\nfloat Blob_Fade_2,\nout vec3 Position,\nout float Near_Size,\nout float Inner_Fade,\nout float Blob_Enable,\nout float Fade,\nout float Pulse)\n{\nPosition=Position1*(1.0-Vx_Color.g)+Vx_Color.g*Position2;\nfloat b1=float(Blob_Enable_1);\nfloat b2=float(Blob_Enable_2);\nBlob_Enable=b1+(b2-b1)*Vx_Color.g;\nPulse=Blob_Pulse_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Pulse_2;\nFade=Blob_Fade_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Fade_2;\nNear_Size=Near_Size_1*(1.0-Vx_Color.g)+Vx_Color.g*Near_Size_2;\nInner_Fade=Blob_Inner_Fade_1*(1.0-Vx_Color.g)+Vx_Color.g*Blob_Inner_Fade_2;\n}\nvoid Wireframe_Vertex_B51(\nvec3 Position,\nvec3 Normal,\nvec3 Tangent,\nvec3 Bitangent,\nfloat Edge_Width,\nvec2 Face_Size,\nout vec3 Wire_Vx_Pos,\nout vec2 UV,\nout vec2 Widths)\n{\nWidths.xy=Edge_Width/Face_Size;\nfloat x=dot(Position,Tangent);\nfloat y=dot(Position,Bitangent);\nfloat dx=0.5-abs(x);\nfloat newx=(0.5-dx*Widths.x*2.0)*sign(x);\nfloat dy=0.5-abs(y);\nfloat newy=(0.5-dy*Widths.y*2.0)*sign(y);\nWire_Vx_Pos=Normal*0.5+newx*Tangent+newy*Bitangent;\nUV.x=dot(Wire_Vx_Pos,Tangent)+0.5;\nUV.y=dot(Wire_Vx_Pos,Bitangent)+0.5;\n}\nvec2 ramp2(vec2 start,vec2 end,vec2 x)\n{\nreturn clamp((x-start)/(end-start),vec2(0.0,0.0),vec2(1.0,1.0));\n}\nfloat computeSelection(\nvec3 blobPosition,\nvec3 normal,\nvec3 tangent,\nvec3 bitangent,\nvec3 faceCenter,\nvec2 faceSize,\nfloat selectionFuzz,\nfloat farDistance,\nfloat fadeLength\n)\n{\nvec3 delta=blobPosition-faceCenter;\nfloat absD=abs(dot(delta,normal));\nfloat fadeIn=1.0-clamp((absD-farDistance)/fadeLength,0.0,1.0);\nvec2 blobCenterXY=vec2(dot(delta,tangent),dot(delta,bitangent));\nvec2 innerFace=faceSize*(1.0-selectionFuzz)*0.5;\nvec2 selectPulse=ramp2(-faceSize*0.5,-innerFace,blobCenterXY)-ramp2(innerFace,faceSize*0.5,blobCenterXY);\nreturn selectPulse.x*selectPulse.y*fadeIn;\n}\nvoid Selection_Vertex_B48(\nvec3 Blob_Position,\nvec3 Blob_Position_2,\nvec3 Face_Center,\nvec2 Face_Size,\nvec3 Normal,\nvec3 Tangent,\nvec3 Bitangent,\nfloat Selection_Fuzz,\nfloat Selected,\nfloat Far_Distance,\nfloat Fade_Length,\nvec3 Active_Face_Dir,\nout float Show_Selection)\n{\nfloat select1=computeSelection(Blob_Position,Normal,Tangent,Bitangent,Face_Center,Face_Size,Selection_Fuzz,Far_Distance,Fade_Length);\nfloat select2=computeSelection(Blob_Position_2,Normal,Tangent,Bitangent,Face_Center,Face_Size,Selection_Fuzz,Far_Distance,Fade_Length);\nfloat Active=max(0.0,dot(Active_Face_Dir,Normal));\nShow_Selection=mix(max(select1,select2),1.0,Selected)*Active;\n}\nvoid Proximity_Visibility_B54(\nfloat Selection,\nvec3 Proximity_Center,\nvec3 Proximity_Center_2,\nfloat Input_Width,\nfloat Proximity_Far_Distance,\nfloat Proximity_Radius,\nvec3 Active_Face_Center,\nvec3 Active_Face_Dir,\nout float Width)\n{\nvec3 boxEdges=(world*vec4(vec3(0.5,0.5,0.5),0.0)).xyz;\nfloat boxMaxSize=length(boxEdges);\nfloat d1=dot(Proximity_Center-Active_Face_Center,Active_Face_Dir);\nvec3 blob1=Proximity_Center-d1*Active_Face_Dir;\nfloat d2=dot(Proximity_Center_2-Active_Face_Center,Active_Face_Dir);\nvec3 blob2=Proximity_Center_2-d2*Active_Face_Dir;\nvec3 delta1=blob1-Active_Face_Center;\nvec3 delta2=blob2-Active_Face_Center;\nfloat dist1=dot(delta1,delta1);\nfloat dist2=dot(delta2,delta2);\nfloat nearestProxDist=sqrt(min(dist1,dist2));\nWidth=Input_Width*(1.0-step(boxMaxSize+Proximity_Radius,nearestProxDist))*(1.0-step(Proximity_Far_Distance,min(d1,d2))*(1.0-step(0.0001,Selection)));\n}\nvoid Object_To_World_Dir_B67(\nvec3 Dir_Object,\nout vec3 Dir_World)\n{\nDir_World=(world*vec4(Dir_Object,0.0)).xyz;\n}\nvoid main()\n{\nvec3 Active_Face_Center_Q49;\nActive_Face_Center_Q49=(world*vec4(_Active_Face_Dir_*0.5,1.0)).xyz;\nvec3 Blob_Position_Q41= mix(_Blob_Position_,Global_Left_Index_Tip_Position.xyz,float(Use_Global_Left_Index));\nvec3 Blob_Position_Q42= mix(_Blob_Position_2_,Global_Right_Index_Tip_Position.xyz,float(Use_Global_Right_Index));\nvec3 Active_Face_Dir_Q64=normalize((world*vec4(_Active_Face_Dir_,0.0)).xyz);\nfloat Relative_Scale_Q57;\n#if RELATIVE_WIDTH\nRelative_Scale_Q57=length((world*vec4(vec3(0,1,0),0.0)).xyz);\n#else\nRelative_Scale_Q57=1.0;\n#endif\nvec3 Tangent_World_Q30;\nTangent_World_Q30=(world*vec4(tangent,0.0)).xyz;\nvec3 Binormal_World_Q31;\nBinormal_World_Q31=(world*vec4((cross(normal,tangent)),0.0)).xyz;\nvec3 Normal_World_Q60;\nNormal_World_Q60=(world*vec4(normal,0.0)).xyz;\nvec3 Result_Q18=0.5*normal;\nvec3 Dir_World_Q67;\nObject_To_World_Dir_B67(_Active_Face_Up_,Dir_World_Q67);\nfloat Product_Q56=_Edge_Width_*Relative_Scale_Q57;\nvec3 Normal_World_N_Q29=normalize(Normal_World_Q60);\nvec3 Tangent_World_N_Q28=normalize(Tangent_World_Q30);\nvec3 Binormal_World_N_Q32=normalize(Binormal_World_Q31);\nvec3 Position_Q38;\nfloat Near_Size_Q38;\nfloat Inner_Fade_Q38;\nfloat Blob_Enable_Q38;\nfloat Fade_Q38;\nfloat Pulse_Q38;\nChoose_Blob_B38(color,Blob_Position_Q41,Blob_Position_Q42,_Blob_Enable_,_Blob_Enable_2_,_Blob_Near_Size_,_Blob_Near_Size_2_,_Blob_Inner_Fade_,_Blob_Inner_Fade_2_,_Blob_Pulse_,_Blob_Pulse_2_,_Blob_Fade_,_Blob_Fade_2_,Position_Q38,Near_Size_Q38,Inner_Fade_Q38,Blob_Enable_Q38,Fade_Q38,Pulse_Q38);\nvec3 Face_Center_Q33;\nFace_Center_Q33=(world*vec4(Result_Q18,1.0)).xyz;\nvec2 Face_Size_Q50=vec2(length(Tangent_World_Q30),length(Binormal_World_Q31));\nfloat Show_Selection_Q48;\nSelection_Vertex_B48(Blob_Position_Q41,Blob_Position_Q42,Face_Center_Q33,Face_Size_Q50,Normal_World_N_Q29,Tangent_World_N_Q28,Binormal_World_N_Q32,_Selection_Fuzz_,_Selected_,_Selected_Distance_,_Selected_Fade_Length_,Active_Face_Dir_Q64,Show_Selection_Q48);\nvec3 Normalized_Q72=normalize(Dir_World_Q67);\nfloat Active_Q34=max(0.0,dot(Active_Face_Dir_Q64,Normal_World_N_Q29));\nfloat Width_Q54;\nProximity_Visibility_B54(Show_Selection_Q48,Blob_Position_Q41,Blob_Position_Q42,Product_Q56,_Proximity_Far_Distance_,_Proximity_Near_Radius_,Active_Face_Center_Q49,Active_Face_Dir_Q64,Width_Q54);\nvec3 Wire_Vx_Pos_Q51;\nvec2 UV_Q51;\nvec2 Widths_Q51;\nWireframe_Vertex_B51(position,normal,tangent,(cross(normal,tangent)),Width_Q54,Face_Size_Q50,Wire_Vx_Pos_Q51,UV_Q51,Widths_Q51);\nvec3 Vec3_Q27=vec3(Widths_Q51.x,Widths_Q51.y,color.r);\nvec3 Pos_World_Q13;\nObject_To_World_Pos_B13(Wire_Vx_Pos_Q51,Pos_World_Q13);\nvec3 Incident_Q36=normalize(Pos_World_Q13-cameraPosition);\nvec3 Out_Position_Q47;\nvec2 Out_UV_Q47;\nvec3 Blob_Info_Q47;\nBlob_Vertex_B47(Pos_World_Q13,Normal_World_N_Q29,Tangent_World_N_Q28,Binormal_World_N_Q32,Position_Q38,_Blob_Intensity_,Near_Size_Q38,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,color,uv,Face_Center_Q33,Face_Size_Q50,UV_Q51,_Blob_Fade_Length_,_Selection_Fade_,_Selection_Fade_Size_,Inner_Fade_Q38,Active_Face_Center_Q49,Pulse_Q38,Fade_Q38,Blob_Enable_Q38,Out_Position_Q47,Out_UV_Q47,Blob_Info_Q47);\nvec4 Extra1_Q66;\nfloat Distance_To_Face_Q66;\nfloat Intensity_Q66;\nProximity_Vertex_B66(Blob_Position_Q41,Blob_Position_Q42,Active_Face_Center_Q49,Active_Face_Dir_Q64,Pos_World_Q13,_Proximity_Far_Distance_,Relative_Scale_Q57,_Proximity_Anisotropy_,Normalized_Q72,Extra1_Q66,Distance_To_Face_Q66,Intensity_Q66);\nvec4 Holo_Edges_Q44;\nHolo_Edge_Vertex_B44(Incident_Q36,Normal_World_N_Q29,uv,Tangent_World_Q30,Binormal_World_Q31,_Smooth_Active_Face_,Active_Q34,Holo_Edges_Q44);\nvec3 Vec3_Q19=vec3(Show_Selection_Q48,Distance_To_Face_Q66,Intensity_Q66);\nvec3 Position=Out_Position_Q47;\nvec2 UV=Out_UV_Q47;\nvec3 Tangent=Blob_Info_Q47;\nvec3 Binormal=Vec3_Q19;\nvec3 Normal=Vec3_Q27;\nvec4 Extra1=Extra1_Q66;\nvec4 Color=Holo_Edges_Q44;\ngl_Position=viewProjection*vec4(Position,1);\nvPosition=Position;\nvNormal=Normal;\nvUV=UV;\nvTangent=Tangent;\nvBinormal=Binormal;\nvColor=Color;\nvExtra1=Extra1;\n}";
// Sideeffect
core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__.ShaderStore.ShadersStore[name] = shader;
/** @hidden */
var fluentButtonVertexShader = { name: name, shader: shader };


/***/ }),

/***/ "../../../lts/gui/dist/3D/materials/handle/handleMaterial.js":
/*!*******************************************************************!*\
  !*** ../../../lts/gui/dist/3D/materials/handle/handleMaterial.js ***!
  \*******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "HandleMaterial": () => (/* binding */ HandleMaterial)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Materials_shaderMaterial__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Maths/math.vector */ "core/Misc/observable");
/* harmony import */ var core_Materials_shaderMaterial__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Materials_shaderMaterial__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _shaders_handle_vertex__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./shaders/handle.vertex */ "../../../lts/gui/dist/3D/materials/handle/shaders/handle.vertex.js");
/* harmony import */ var _shaders_handle_fragment__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./shaders/handle.fragment */ "../../../lts/gui/dist/3D/materials/handle/shaders/handle.fragment.js");






/**
 * Class used to render gizmo handles with fluent design
 */
var HandleMaterial = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(HandleMaterial, _super);
    /**
     * Creates a handle material
     * @param name Name of the material
     * @param scene Scene
     */
    function HandleMaterial(name, scene) {
        var _this = _super.call(this, name, scene, "handle", {
            attributes: ["position"],
            uniforms: ["worldViewProjection", "color", "scale", "positionOffset"],
            needAlphaBlending: false,
            needAlphaTesting: false,
        }) || this;
        _this._hover = false;
        _this._drag = false;
        _this._color = new core_Materials_shaderMaterial__WEBPACK_IMPORTED_MODULE_1__.Color3();
        _this._scale = 1;
        _this._lastTick = -1;
        /**
         * Length of animation
         */
        _this.animationLength = 100;
        /**
         * Color of the handle when hovered
         */
        _this.hoverColor = new core_Materials_shaderMaterial__WEBPACK_IMPORTED_MODULE_1__.Color3(0, 0.467, 0.84);
        /**
         * Color of the handle when idle
         */
        _this.baseColor = new core_Materials_shaderMaterial__WEBPACK_IMPORTED_MODULE_1__.Color3(1, 1, 1);
        /**
         * Scale of the handle when hovered
         */
        _this.hoverScale = 0.75;
        /**
         * Scale of the handle when idle
         */
        _this.baseScale = 0.35;
        /**
         * Scale of the handle when dragged
         */
        _this.dragScale = 0.55;
        /**
         * @hidden
         */
        _this._positionOffset = core_Materials_shaderMaterial__WEBPACK_IMPORTED_MODULE_1__.Vector3.Zero();
        _this._updateInterpolationTarget();
        // Register callback for scene after render
        _this._lastTick = Date.now();
        _this._onBeforeRender = _this.getScene().onBeforeRenderObservable.add(function () {
            var tick = Date.now();
            var delta = tick - _this._lastTick;
            var scaleDiff = _this._targetScale - _this._scale;
            var colorDiff = core_Materials_shaderMaterial__WEBPACK_IMPORTED_MODULE_1__.TmpColors.Color3[0].copyFrom(_this._targetColor).subtractToRef(_this._color, core_Materials_shaderMaterial__WEBPACK_IMPORTED_MODULE_1__.TmpColors.Color3[0]);
            _this._scale = _this._scale + (scaleDiff * delta) / _this.animationLength;
            colorDiff.scaleToRef(delta / _this.animationLength, colorDiff);
            _this._color.addToRef(colorDiff, _this._color);
            _this.setColor3("color", _this._color);
            _this.setFloat("scale", _this._scale);
            _this.setVector3("positionOffset", _this._positionOffset);
            _this._lastTick = tick;
        });
        return _this;
    }
    Object.defineProperty(HandleMaterial.prototype, "hover", {
        /**
         * Is the material indicating hovering state
         */
        get: function () {
            return this._hover;
        },
        set: function (b) {
            this._hover = b;
            this._updateInterpolationTarget();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(HandleMaterial.prototype, "drag", {
        /**
         * Is the material indicating drag state
         */
        get: function () {
            return this._drag;
        },
        set: function (b) {
            this._drag = b;
            this._updateInterpolationTarget();
        },
        enumerable: false,
        configurable: true
    });
    HandleMaterial.prototype._updateInterpolationTarget = function () {
        if (this.drag) {
            this._targetColor = this.hoverColor;
            this._targetScale = this.dragScale;
        }
        else if (this.hover) {
            this._targetColor = this.hoverColor;
            this._targetScale = this.hoverScale;
        }
        else {
            this._targetColor = this.baseColor;
            this._targetScale = this.baseScale;
        }
    };
    /**
     * Disposes the handle material
     */
    HandleMaterial.prototype.dispose = function () {
        _super.prototype.dispose.call(this);
        this.getScene().onBeforeRenderObservable.remove(this._onBeforeRender);
    };
    return HandleMaterial;
}(core_Materials_shaderMaterial__WEBPACK_IMPORTED_MODULE_1__.ShaderMaterial));



/***/ }),

/***/ "../../../lts/gui/dist/3D/materials/handle/index.js":
/*!**********************************************************!*\
  !*** ../../../lts/gui/dist/3D/materials/handle/index.js ***!
  \**********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "HandleMaterial": () => (/* reexport safe */ _handleMaterial__WEBPACK_IMPORTED_MODULE_0__.HandleMaterial)
/* harmony export */ });
/* harmony import */ var _handleMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./handleMaterial */ "../../../lts/gui/dist/3D/materials/handle/handleMaterial.js");



/***/ }),

/***/ "../../../lts/gui/dist/3D/materials/handle/shaders/handle.fragment.js":
/*!****************************************************************************!*\
  !*** ../../../lts/gui/dist/3D/materials/handle/shaders/handle.fragment.js ***!
  \****************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "handlePixelShader": () => (/* binding */ handlePixelShader)
/* harmony export */ });
/* harmony import */ var core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Engines/shaderStore */ "core/Misc/observable");
/* harmony import */ var core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);
// Do not edit.

var name = "handlePixelShader";
var shader = "uniform vec3 color;\nvoid main(void) {\ngl_FragColor=vec4(color,1.0);\n}";
// Sideeffect
core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__.ShaderStore.ShadersStore[name] = shader;
/** @hidden */
var handlePixelShader = { name: name, shader: shader };


/***/ }),

/***/ "../../../lts/gui/dist/3D/materials/handle/shaders/handle.vertex.js":
/*!**************************************************************************!*\
  !*** ../../../lts/gui/dist/3D/materials/handle/shaders/handle.vertex.js ***!
  \**************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "handleVertexShader": () => (/* binding */ handleVertexShader)
/* harmony export */ });
/* harmony import */ var core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Engines/shaderStore */ "core/Misc/observable");
/* harmony import */ var core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);
// Do not edit.

var name = "handleVertexShader";
var shader = "precision highp float;\nattribute vec3 position;\nuniform vec3 positionOffset;\nuniform mat4 worldViewProjection;\nuniform float scale;\nvoid main(void) {\nvec4 vPos=vec4((vec3(position)+positionOffset)*scale,1.0);\ngl_Position=worldViewProjection*vPos;\n}";
// Sideeffect
core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__.ShaderStore.ShadersStore[name] = shader;
/** @hidden */
var handleVertexShader = { name: name, shader: shader };


/***/ }),

/***/ "../../../lts/gui/dist/3D/materials/index.js":
/*!***************************************************!*\
  !*** ../../../lts/gui/dist/3D/materials/index.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "FluentBackplateMaterial": () => (/* reexport safe */ _fluentBackplate_index__WEBPACK_IMPORTED_MODULE_2__.FluentBackplateMaterial),
/* harmony export */   "FluentButtonMaterial": () => (/* reexport safe */ _fluentButton_index__WEBPACK_IMPORTED_MODULE_1__.FluentButtonMaterial),
/* harmony export */   "FluentMaterial": () => (/* reexport safe */ _fluent_index__WEBPACK_IMPORTED_MODULE_0__.FluentMaterial),
/* harmony export */   "FluentMaterialDefines": () => (/* reexport safe */ _fluent_index__WEBPACK_IMPORTED_MODULE_0__.FluentMaterialDefines),
/* harmony export */   "HandleMaterial": () => (/* reexport safe */ _handle_index__WEBPACK_IMPORTED_MODULE_3__.HandleMaterial),
/* harmony export */   "MRDLBackplateMaterial": () => (/* reexport safe */ _mrdl_index__WEBPACK_IMPORTED_MODULE_4__.MRDLBackplateMaterial),
/* harmony export */   "MRDLSliderBarMaterial": () => (/* reexport safe */ _mrdl_index__WEBPACK_IMPORTED_MODULE_4__.MRDLSliderBarMaterial),
/* harmony export */   "MRDLSliderThumbMaterial": () => (/* reexport safe */ _mrdl_index__WEBPACK_IMPORTED_MODULE_4__.MRDLSliderThumbMaterial)
/* harmony export */ });
/* harmony import */ var _fluent_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./fluent/index */ "../../../lts/gui/dist/3D/materials/fluent/index.js");
/* harmony import */ var _fluentButton_index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fluentButton/index */ "../../../lts/gui/dist/3D/materials/fluentButton/index.js");
/* harmony import */ var _fluentBackplate_index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fluentBackplate/index */ "../../../lts/gui/dist/3D/materials/fluentBackplate/index.js");
/* harmony import */ var _handle_index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./handle/index */ "../../../lts/gui/dist/3D/materials/handle/index.js");
/* harmony import */ var _mrdl_index__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./mrdl/index */ "../../../lts/gui/dist/3D/materials/mrdl/index.js");
/* eslint-disable import/no-internal-modules */







/***/ }),

/***/ "../../../lts/gui/dist/3D/materials/mrdl/index.js":
/*!********************************************************!*\
  !*** ../../../lts/gui/dist/3D/materials/mrdl/index.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "MRDLBackplateMaterial": () => (/* reexport safe */ _mrdlBackplateMaterial__WEBPACK_IMPORTED_MODULE_2__.MRDLBackplateMaterial),
/* harmony export */   "MRDLSliderBarMaterial": () => (/* reexport safe */ _mrdlSliderBarMaterial__WEBPACK_IMPORTED_MODULE_0__.MRDLSliderBarMaterial),
/* harmony export */   "MRDLSliderThumbMaterial": () => (/* reexport safe */ _mrdlSliderThumbMaterial__WEBPACK_IMPORTED_MODULE_1__.MRDLSliderThumbMaterial)
/* harmony export */ });
/* harmony import */ var _mrdlSliderBarMaterial__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mrdlSliderBarMaterial */ "../../../lts/gui/dist/3D/materials/mrdl/mrdlSliderBarMaterial.js");
/* harmony import */ var _mrdlSliderThumbMaterial__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mrdlSliderThumbMaterial */ "../../../lts/gui/dist/3D/materials/mrdl/mrdlSliderThumbMaterial.js");
/* harmony import */ var _mrdlBackplateMaterial__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mrdlBackplateMaterial */ "../../../lts/gui/dist/3D/materials/mrdl/mrdlBackplateMaterial.js");





/***/ }),

/***/ "../../../lts/gui/dist/3D/materials/mrdl/mrdlBackplateMaterial.js":
/*!************************************************************************!*\
  !*** ../../../lts/gui/dist/3D/materials/mrdl/mrdlBackplateMaterial.js ***!
  \************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "MRDLBackplateMaterial": () => (/* binding */ MRDLBackplateMaterial)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Engines/constants */ "core/Misc/observable");
/* harmony import */ var core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _shaders_mrdlBackplate_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./shaders/mrdlBackplate.fragment */ "../../../lts/gui/dist/3D/materials/mrdl/shaders/mrdlBackplate.fragment.js");
/* harmony import */ var _shaders_mrdlBackplate_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./shaders/mrdlBackplate.vertex */ "../../../lts/gui/dist/3D/materials/mrdl/shaders/mrdlBackplate.vertex.js");














/** @hidden */
var MRDLBackplateMaterialDefines = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(MRDLBackplateMaterialDefines, _super);
    function MRDLBackplateMaterialDefines() {
        var _this = _super.call(this) || this;
        /*
            "IRIDESCENCE_ENABLE", "SMOOTH_EDGES"
        */
        _this.IRIDESCENCE_ENABLED = true;
        _this.SMOOTH_EDGES = true;
        _this._needNormals = true;
        _this.rebuild();
        return _this;
    }
    return MRDLBackplateMaterialDefines;
}(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.MaterialDefines));
/**
 * Class used to render backplate material with MRDL
 */
var MRDLBackplateMaterial = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(MRDLBackplateMaterial, _super);
    function MRDLBackplateMaterial(name, scene) {
        var _this = _super.call(this, name, scene) || this;
        /**
         * Gets or sets the corner radius on the backplate. If this value is changed, update the lineWidth to match.
         */
        _this.radius = 0.3;
        /**
         * Gets or sets the line width of the backplate.
         */
        _this.lineWidth = 0.003;
        /**
         * Gets or sets whether to use absolute sizes when calculating effects on the backplate.
         * Since desktop and VR/AR have different relative sizes, it's usually best to keep this false.
         */
        _this.absoluteSizes = false;
        /** @hidden */
        _this._filterWidth = 1;
        /**
         * Gets or sets the base color of the backplate.
         */
        _this.baseColor = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Color4(0, 0, 0, 1);
        /**
         * Gets or sets the line color of the backplate.
         */
        _this.lineColor = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Color4(0.2, 0.262745, 0.4, 1);
        /**
         * Gets or sets the top left Radii Multiplier.
         */
        _this.radiusTopLeft = 1.0;
        /**
         * Gets or sets the top left Radii Multiplier.
         */
        _this.radiusTopRight = 1.0;
        /**
         * Gets or sets the top left Radii Multiplier.
         */
        _this.radiusBottomLeft = 1.0;
        /**
         * Gets or sets the top left Radii Multiplier.
         */
        _this.radiusBottomRight = 1.0;
        /** @hidden */
        _this._rate = 0;
        /**
         * Gets or sets the color of the highlights on the backplate line.
         */
        _this.highlightColor = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Color4(0.239216, 0.435294, 0.827451, 1);
        /**
         * Gets or sets the width of the highlights on the backplate line.
         */
        _this.highlightWidth = 0;
        /** @hidden */
        _this._highlightTransform = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector4(1, 1, 0, 0);
        /** @hidden */
        _this._highlight = 1;
        /**
         * Gets or sets the intensity of the iridescence effect.
         */
        _this.iridescenceIntensity = 0.45;
        /**
         * Gets or sets the intensity of the iridescence effect on the backplate edges.
         */
        _this.iridescenceEdgeIntensity = 1;
        /**
         * Gets or sets the Tint of the iridescence effect on the backplate.
         */
        _this.iridescenceTint = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Color4(1, 1, 1, 1);
        /** @hidden */
        _this._angle = -45;
        /**
         * Gets or sets the opacity of the backplate (0.0 - 1.0).
         */
        _this.fadeOut = 1;
        /** @hidden */
        _this._reflected = true;
        /** @hidden */
        _this._frequency = 1;
        /** @hidden */
        _this._verticalOffset = 0;
        /**
         * Gets or sets the gradient color effect on the backplate.
         */
        _this.gradientColor = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Color4(0.74902, 0.74902, 0.74902, 1);
        /**
         * Gets or sets the top left gradient color effect on the backplate.
         */
        _this.topLeftGradientColor = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Color4(0.00784314, 0.294118, 0.580392, 1);
        /**
         * Gets or sets the top right gradient color effect on the backplate.
         */
        _this.topRightGradientColor = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Color4(0.305882, 0, 1, 1);
        /**
         * Gets or sets the bottom left gradient color effect on the backplate.
         */
        _this.bottomLeftGradientColor = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Color4(0.133333, 0.258824, 0.992157, 1);
        /**
         * Gets or sets the bottom right gradient color effect on the backplate.
         */
        _this.bottomRightGradientColor = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Color4(0.176471, 0.176471, 0.619608, 1);
        /**
         * Gets or sets the edge width of the backplate.
         */
        _this.edgeWidth = 0.5;
        /**
         * Gets or sets the edge width of the backplate.
         */
        _this.edgePower = 1;
        /**
         * Gets or sets the edge width of the backplate.
         */
        _this.edgeLineGradientBlend = 0.5;
        _this.alphaMode = core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Constants.ALPHA_DISABLE;
        _this.backFaceCulling = false;
        _this._iridescentMapTexture = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Texture(MRDLBackplateMaterial.IRIDESCENT_MAP_TEXTURE_URL, _this.getScene(), true, false, core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Texture.NEAREST_SAMPLINGMODE);
        return _this;
    }
    MRDLBackplateMaterial.prototype.needAlphaBlending = function () {
        return false;
    };
    MRDLBackplateMaterial.prototype.needAlphaTesting = function () {
        return false;
    };
    MRDLBackplateMaterial.prototype.getAlphaTestTexture = function () {
        return null;
    };
    // Methods
    MRDLBackplateMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh) {
        if (this.isFrozen) {
            if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {
                return true;
            }
        }
        if (!subMesh.materialDefines) {
            subMesh.materialDefines = new MRDLBackplateMaterialDefines();
        }
        var defines = subMesh.materialDefines;
        var scene = this.getScene();
        if (this._isReadyForSubMesh(subMesh)) {
            return true;
        }
        var engine = scene.getEngine();
        // Attribs
        core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, false, false);
        // Get correct effect
        if (defines.isDirty) {
            defines.markAsProcessed();
            scene.resetCachedMaterial();
            // Fallbacks
            var fallbacks = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.EffectFallbacks();
            if (defines.FOG) {
                fallbacks.addFallback(1, "FOG");
            }
            core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.MaterialHelper.HandleFallbacksForShadows(defines, fallbacks);
            defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;
            //Attributes
            var attribs = [core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.VertexBuffer.PositionKind];
            if (defines.NORMAL) {
                attribs.push(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.VertexBuffer.NormalKind);
            }
            if (defines.UV1) {
                attribs.push(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.VertexBuffer.UVKind);
            }
            if (defines.UV2) {
                attribs.push(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.VertexBuffer.UV2Kind);
            }
            if (defines.VERTEXCOLOR) {
                attribs.push(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.VertexBuffer.ColorKind);
            }
            if (defines.TANGENT) {
                attribs.push(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.VertexBuffer.TangentKind);
            }
            core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.MaterialHelper.PrepareAttributesForInstances(attribs, defines);
            // Legacy browser patch
            var shaderName = "mrdlBackplate";
            var join = defines.toString();
            var uniforms = [
                "world",
                "viewProjection",
                "cameraPosition",
                "_Radius_",
                "_Line_Width_",
                "_Absolute_Sizes_",
                "_Filter_Width_",
                "_Base_Color_",
                "_Line_Color_",
                "_Radius_Top_Left_",
                "_Radius_Top_Right_",
                "_Radius_Bottom_Left_",
                "_Radius_Bottom_Right_",
                "_Rate_",
                "_Highlight_Color_",
                "_Highlight_Width_",
                "_Highlight_Transform_",
                "_Highlight_",
                "_Iridescence_Intensity_",
                "_Iridescence_Edge_Intensity_",
                "_Iridescence_Tint_",
                "_Iridescent_Map_",
                "_Angle_",
                "_Reflected_",
                "_Frequency_",
                "_Vertical_Offset_",
                "_Gradient_Color_",
                "_Top_Left_",
                "_Top_Right_",
                "_Bottom_Left_",
                "_Bottom_Right_",
                "_Edge_Width_",
                "_Edge_Power_",
                "_Line_Gradient_Blend_",
                "_Fade_Out_",
            ];
            var samplers = [];
            var uniformBuffers = new Array();
            core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.MaterialHelper.PrepareUniformsAndSamplersList({
                uniformsNames: uniforms,
                uniformBuffersNames: uniformBuffers,
                samplers: samplers,
                defines: defines,
                maxSimultaneousLights: 4,
            });
            subMesh.setEffect(scene.getEngine().createEffect(shaderName, {
                attributes: attribs,
                uniformsNames: uniforms,
                uniformBuffersNames: uniformBuffers,
                samplers: samplers,
                defines: join,
                fallbacks: fallbacks,
                onCompiled: this.onCompiled,
                onError: this.onError,
                indexParameters: { maxSimultaneousLights: 4 },
            }, engine), defines);
        }
        if (!subMesh.effect || !subMesh.effect.isReady()) {
            return false;
        }
        defines._renderId = scene.getRenderId();
        subMesh.effect._wasPreviouslyReady = true;
        return true;
    };
    MRDLBackplateMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) {
        var defines = subMesh.materialDefines;
        if (!defines) {
            return;
        }
        var effect = subMesh.effect;
        if (!effect) {
            return;
        }
        this._activeEffect = effect;
        // Matrices
        this.bindOnlyWorldMatrix(world);
        this._activeEffect.setMatrix("viewProjection", this.getScene().getTransformMatrix());
        this._activeEffect.setVector3("cameraPosition", this.getScene().activeCamera.position);
        // "Round Rect"
        this._activeEffect.setFloat("_Radius_", this.radius);
        this._activeEffect.setFloat("_Line_Width_", this.lineWidth);
        this._activeEffect.setFloat("_Absolute_Sizes_", this.absoluteSizes ? 1.0 : 0.0);
        this._activeEffect.setFloat("_Filter_Width_", this._filterWidth);
        this._activeEffect.setDirectColor4("_Base_Color_", this.baseColor);
        this._activeEffect.setDirectColor4("_Line_Color_", this.lineColor);
        // "Radii Multipliers"
        this._activeEffect.setFloat("_Radius_Top_Left_", this.radiusTopLeft);
        this._activeEffect.setFloat("_Radius_Top_Right_", this.radiusTopRight);
        this._activeEffect.setFloat("_Radius_Bottom_Left_", this.radiusBottomLeft);
        this._activeEffect.setFloat("_Radius_Bottom_Right_", this.radiusBottomRight);
        // "Line Highlight"
        this._activeEffect.setFloat("_Rate_", this._rate);
        this._activeEffect.setDirectColor4("_Highlight_Color_", this.highlightColor);
        this._activeEffect.setFloat("_Highlight_Width_", this.highlightWidth);
        this._activeEffect.setVector4("_Highlight_Transform_", this._highlightTransform);
        this._activeEffect.setFloat("_Highlight_", this._highlight);
        // "Iridescence"
        //define IRIDESCENCE_ENABLE true;
        this._activeEffect.setFloat("_Iridescence_Intensity_", this.iridescenceIntensity);
        this._activeEffect.setFloat("_Iridescence_Edge_Intensity_", this.iridescenceEdgeIntensity);
        this._activeEffect.setDirectColor4("_Iridescence_Tint_", this.iridescenceTint);
        this._activeEffect.setTexture("_Iridescent_Map_", this._iridescentMapTexture);
        this._activeEffect.setFloat("_Angle_", this._angle);
        this._activeEffect.setFloat("_Reflected_", this._reflected ? 1.0 : 0.0);
        this._activeEffect.setFloat("_Frequency_", this._frequency);
        this._activeEffect.setFloat("_Vertical_Offset_", this._verticalOffset);
        // "Gradient"
        this._activeEffect.setDirectColor4("_Gradient_Color_", this.gradientColor);
        this._activeEffect.setDirectColor4("_Top_Left_", this.topLeftGradientColor);
        this._activeEffect.setDirectColor4("_Top_Right_", this.topRightGradientColor);
        this._activeEffect.setDirectColor4("_Bottom_Left_", this.bottomLeftGradientColor);
        this._activeEffect.setDirectColor4("_Bottom_Right_", this.bottomRightGradientColor);
        //define EDGE_ONLY false;
        this._activeEffect.setFloat("_Edge_Width_", this.edgeWidth);
        this._activeEffect.setFloat("_Edge_Power_", this.edgePower);
        this._activeEffect.setFloat("_Line_Gradient_Blend_", this.edgeLineGradientBlend);
        // "Fade"
        this._activeEffect.setFloat("_Fade_Out_", this.fadeOut);
        // "Antialiasing"
        //define SMOOTH_EDGES true;
        this._afterBind(mesh, this._activeEffect);
    };
    /**
     * Get the list of animatables in the material.
     * @returns the list of animatables object used in the material
     */
    MRDLBackplateMaterial.prototype.getAnimatables = function () {
        return [];
    };
    MRDLBackplateMaterial.prototype.dispose = function (forceDisposeEffect) {
        _super.prototype.dispose.call(this, forceDisposeEffect);
    };
    MRDLBackplateMaterial.prototype.clone = function (name) {
        var _this = this;
        return core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.SerializationHelper.Clone(function () { return new MRDLBackplateMaterial(name, _this.getScene()); }, this);
    };
    MRDLBackplateMaterial.prototype.serialize = function () {
        var serializationObject = _super.prototype.serialize.call(this);
        serializationObject.customType = "BABYLON.MRDLBackplateMaterial";
        return serializationObject;
    };
    MRDLBackplateMaterial.prototype.getClassName = function () {
        return "MRDLBackplateMaterial";
    };
    // Statics
    MRDLBackplateMaterial.Parse = function (source, scene, rootUrl) {
        return core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.SerializationHelper.Parse(function () { return new MRDLBackplateMaterial(source.name, scene); }, source, scene, rootUrl);
    };
    /**
     * URL pointing to the texture used to define the coloring for the Iridescent Map effect.
     */
    MRDLBackplateMaterial.IRIDESCENT_MAP_TEXTURE_URL = "https://assets.babylonjs.com/meshes/MRTK/MRDL/mrtk-mrdl-backplate-iridescence.png";
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLBackplateMaterial.prototype, "radius", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLBackplateMaterial.prototype, "lineWidth", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLBackplateMaterial.prototype, "absoluteSizes", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLBackplateMaterial.prototype, "baseColor", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLBackplateMaterial.prototype, "lineColor", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLBackplateMaterial.prototype, "radiusTopLeft", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLBackplateMaterial.prototype, "radiusTopRight", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLBackplateMaterial.prototype, "radiusBottomLeft", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLBackplateMaterial.prototype, "radiusBottomRight", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLBackplateMaterial.prototype, "highlightColor", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLBackplateMaterial.prototype, "highlightWidth", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLBackplateMaterial.prototype, "iridescenceIntensity", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLBackplateMaterial.prototype, "iridescenceEdgeIntensity", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLBackplateMaterial.prototype, "iridescenceTint", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLBackplateMaterial.prototype, "fadeOut", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLBackplateMaterial.prototype, "gradientColor", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLBackplateMaterial.prototype, "topLeftGradientColor", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLBackplateMaterial.prototype, "topRightGradientColor", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLBackplateMaterial.prototype, "bottomLeftGradientColor", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLBackplateMaterial.prototype, "bottomRightGradientColor", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLBackplateMaterial.prototype, "edgeWidth", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLBackplateMaterial.prototype, "edgePower", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLBackplateMaterial.prototype, "edgeLineGradientBlend", void 0);
    return MRDLBackplateMaterial;
}(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.PushMaterial));

(0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.RegisterClass)("BABYLON.GUI.MRDLBackplateMaterial", MRDLBackplateMaterial);


/***/ }),

/***/ "../../../lts/gui/dist/3D/materials/mrdl/mrdlSliderBarMaterial.js":
/*!************************************************************************!*\
  !*** ../../../lts/gui/dist/3D/materials/mrdl/mrdlSliderBarMaterial.js ***!
  \************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "MRDLSliderBarMaterial": () => (/* binding */ MRDLSliderBarMaterial)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Engines/constants */ "core/Misc/observable");
/* harmony import */ var core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _shaders_mrdlSliderBar_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./shaders/mrdlSliderBar.fragment */ "../../../lts/gui/dist/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.js");
/* harmony import */ var _shaders_mrdlSliderBar_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./shaders/mrdlSliderBar.vertex */ "../../../lts/gui/dist/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.js");














/** @hidden */
var MRDLSliderBarMaterialDefines = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(MRDLSliderBarMaterialDefines, _super);
    function MRDLSliderBarMaterialDefines() {
        var _this = _super.call(this) || this;
        /*
            "SKY_ENABLED", "BLOB_ENABLE_2", "IRIDESCENCE_ENABLED"
        */
        _this.SKY_ENABLED = true;
        _this.BLOB_ENABLE_2 = true;
        _this.IRIDESCENCE_ENABLED = true;
        _this._needNormals = true;
        _this._needUVs = true;
        _this.rebuild();
        return _this;
    }
    return MRDLSliderBarMaterialDefines;
}(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.MaterialDefines));
/**
 * Class used to render Slider Bar material with MRDL
 */
var MRDLSliderBarMaterial = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(MRDLSliderBarMaterial, _super);
    function MRDLSliderBarMaterial(name, scene) {
        var _this = _super.call(this, name, scene) || this;
        /**
         * Gets or sets the corner Radius on the slider bar.
         */
        _this.radius = 0.6;
        /**
         * Gets or sets the Bevel Front on the slider bar.
         */
        _this.bevelFront = 0.6;
        /**
         * Gets or sets the Bevel Front Stretch on the slider bar.
         */
        _this.bevelFrontStretch = 0.077;
        /**
         * Gets or sets the Bevel Back on the slider bar.
         */
        _this.bevelBack = 0;
        /**
         * Gets or sets the Bevel Back Stretch on the slider bar.
         */
        _this.bevelBackStretch = 0;
        /**
         * Gets or sets the top left Radii Multiplier.
         */
        _this.radiusTopLeft = 1.0;
        /**
         * Gets or sets the top left Radii Multiplier.
         */
        _this.radiusTopRight = 1.0;
        /**
         * Gets or sets the top left Radii Multiplier.
         */
        _this.radiusBottomLeft = 1.0;
        /**
         * Gets or sets the top left Radii Multiplier.
         */
        _this.radiusBottomRight = 1.0;
        /**
         * Gets or sets whether Bulge is enabled.
         * Default is false.
         */
        _this.bulgeEnabled = false;
        /**
         * Gets or sets the Bulge Height.
         */
        _this.bulgeHeight = -0.323;
        /**
         * Gets or sets the Bulge Radius.
         */
        _this.bulgeRadius = 0.73;
        /**
         * Gets or sets the Sun Intensity.
         */
        _this.sunIntensity = 1.102;
        /**
         * Gets or sets the Sun Theta.
         */
        _this.sunTheta = 0.76;
        /**
         * Gets or sets the Sun Phi.
         */
        _this.sunPhi = 0.526;
        /**
         * Gets or sets the Indirect Diffuse.
         */
        _this.indirectDiffuse = 0.658;
        /**
         * Gets or sets the base albedo.
         */
        _this.albedo = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Color4(0.0117647, 0.505882, 0.996078, 1);
        /**
         * Gets or sets the Specular value.
         */
        _this.specular = 0;
        /**
         * Gets or sets the Shininess value.
         */
        _this.shininess = 10;
        /**
         * Gets or sets the Sharpness value.
         */
        _this.sharpness = 0;
        /**
         * Gets or sets the Subsurface value.
         */
        _this.subsurface = 0;
        /**
         * Gets or sets the left gradient color.
         */
        _this.leftGradientColor = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Color4(0.0117647, 0.505882, 0.996078, 1);
        /**
         * Gets or sets the right gradient color.
         */
        _this.rightGradientColor = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Color4(0.0117647, 0.505882, 0.996078, 1);
        /**
         * Gets or sets the reflection value.
         */
        _this.reflection = 0.749;
        /**
         * Gets or sets the front reflect value.
         */
        _this.frontReflect = 0;
        /**
         * Gets or sets the edge reflect value.
         */
        _this.edgeReflect = 0.09;
        /**
         * Gets or sets the power value.
         */
        _this.power = 8.13;
        /**
         * Gets or sets the sky color.
         */
        _this.skyColor = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Color4(0.0117647, 0.964706, 0.996078, 1);
        /**
         * Gets or sets the horizon color.
         */
        _this.horizonColor = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Color4(0.0117647, 0.333333, 0.996078, 1);
        /**
         * Gets or sets the ground color.
         */
        _this.groundColor = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Color4(0, 0.254902, 0.996078, 1);
        /**
         * Gets or sets the horizon power value.
         */
        _this.horizonPower = 1;
        /**
         * Gets or sets the finger occlusion width value.
         */
        _this.width = 0.02;
        /**
         * Gets or sets the finger occlusion fuzz value.
         */
        _this.fuzz = 0.5;
        /**
         * Gets or sets the minimum finger occlusion fuzz value.
         */
        _this.minFuzz = 0.001;
        /**
         * Gets or sets the finger occlusion clip fade value.
         */
        _this.clipFade = 0.01;
        /**
         * Gets or sets the hue shift value.
         */
        _this.hueShift = 0;
        /**
         * Gets or sets the saturation shift value.
         */
        _this.saturationShift = 0;
        /**
         * Gets or sets the value shift.
         */
        _this.valueShift = 0;
        /**
         * Gets or sets the position of the hover glow effect.
         */
        _this.blobPosition = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector3(0, 0, 0.1);
        /**
         * Gets or sets the intensity of the hover glow effect.
         */
        _this.blobIntensity = 0.5;
        /**
         * Gets or sets the near size of the hover glow effect.
         */
        _this.blobNearSize = 0.01;
        /**
         * Gets or sets the far size of the hover glow effect.
         */
        _this.blobFarSize = 0.03;
        /**
         * Gets or sets the distance considered "near" to the mesh, which controls the size of the hover glow effect (see blobNearSize).
         */
        _this.blobNearDistance = 0;
        /**
         * Gets or sets the distance considered "far" from the mesh, which controls the size of the hover glow effect (see blobFarSize).
         */
        _this.blobFarDistance = 0.08;
        /**
         * Gets or sets the length of the hover glow effect fade.
         */
        _this.blobFadeLength = 0.576;
        /**
         * Gets or sets the progress of the hover glow effect selection animation corresponding to the left pointer (0.0 - 1.0).
         */
        _this.blobPulse = 0;
        /**
         * Gets or sets the opacity of the hover glow effect corresponding to the left pointer (0.0 - 1.0). Default is 0.
         */
        _this.blobFade = 1;
        /**
         * Gets or sets the position of the hover glow effect.
         */
        _this.blobPosition2 = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector3(0.2, 0, 0.1);
        /**
         * Gets or sets the size of the hover glow effect when the right pointer is considered "near" to the mesh (see blobNearDistance).
         */
        _this.blobNearSize2 = 0.01;
        /**
         * Gets or sets the progress of the hover glow effect selection animation corresponding to the right pointer (0.0 - 1.0).
         */
        _this.blobPulse2 = 0;
        /**
         * Gets or sets the opacity of the hover glow effect corresponding to the right pointer (0.0 - 1.0). Default is 1.
         */
        _this.blobFade2 = 1;
        /**
         * Gets or sets the texture of the hover glow effect.
         */
        _this.blobTexture = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Texture("", _this.getScene());
        /**
         * Gets or sets the finger position for left index.
         */
        _this.leftIndexPosition = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector3(0, 0, 1);
        /**
         * Gets or sets the finger position for right index.
         */
        _this.rightIndexPosition = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector3(-1, -1, -1);
        /**
         * Gets or sets the finger position for left index middle position.
         */
        _this.leftIndexMiddlePosition = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector3(0, 0, 0);
        /**
         * Gets or sets the finger position for right index middle position.
         */
        _this.rightIndexMiddlePosition = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector3(0, 0, 0);
        /**
         * Gets or sets the Decal Scle for XY.
         */
        _this.decalScaleXY = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector2(1.5, 1.5);
        /**
         * Gets or sets decalFrontOnly
         * Default is true
         */
        _this.decalFrontOnly = true;
        /**
         * Gets or sets the Rim Light intensity.
         */
        _this.rimIntensity = 0.287;
        /**
         * Gets or sets the Rim Light hue shift value.
         */
        _this.rimHueShift = 0;
        /**
         * Gets or sets the Rim Light saturation shift value.
         */
        _this.rimSaturationShift = 0;
        /**
         * Gets or sets the Rim Light value shift.
         */
        _this.rimValueShift = -1;
        /**
         * Gets or sets the intensity of the iridescence effect.
         */
        _this.iridescenceIntensity = 0;
        /**
         * @hidden
         */
        _this.useGlobalLeftIndex = 1.0;
        /**
         * @hidden
         */
        _this.useGlobalRightIndex = 1.0;
        /**
         * @hidden
         */
        _this.globalLeftIndexTipProximity = 0.0;
        /**
         * @hidden
         */
        _this.globalRightIndexTipProximity = 0.0;
        /**
         * @hidden
         */
        _this.globalLeftIndexTipPosition = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector4(0.5, 0.0, -0.55, 1.0);
        /**
         * @hidden
         */
        _this.globaRightIndexTipPosition = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector4(0.0, 0.0, 0.0, 1.0);
        /**
         * @hidden
         */
        _this.globalLeftThumbTipPosition = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector4(0.5, 0.0, -0.55, 1.0);
        /**
         * @hidden
         */
        _this.globalRightThumbTipPosition = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector4(0.0, 0.0, 0.0, 1.0);
        /**
         * @hidden
         */
        _this.globalLeftIndexMiddlePosition = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector4(0.5, 0.0, -0.55, 1.0);
        /**
         * @hidden
         */
        _this.globalRightIndexMiddlePosition = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector4(0.0, 0.0, 0.0, 1.0);
        _this.alphaMode = core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Constants.ALPHA_DISABLE;
        _this.backFaceCulling = false;
        _this._blueGradientTexture = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Texture(MRDLSliderBarMaterial.BLUE_GRADIENT_TEXTURE_URL, _this.getScene(), true, false, core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Texture.NEAREST_SAMPLINGMODE);
        return _this;
    }
    MRDLSliderBarMaterial.prototype.needAlphaBlending = function () {
        return false;
    };
    MRDLSliderBarMaterial.prototype.needAlphaTesting = function () {
        return false;
    };
    MRDLSliderBarMaterial.prototype.getAlphaTestTexture = function () {
        return null;
    };
    // Methods
    MRDLSliderBarMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh) {
        if (this.isFrozen) {
            if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {
                return true;
            }
        }
        if (!subMesh.materialDefines) {
            subMesh.materialDefines = new MRDLSliderBarMaterialDefines();
        }
        var defines = subMesh.materialDefines;
        var scene = this.getScene();
        if (this._isReadyForSubMesh(subMesh)) {
            return true;
        }
        var engine = scene.getEngine();
        // Attribs
        core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, false, false);
        // Get correct effect
        if (defines.isDirty) {
            defines.markAsProcessed();
            scene.resetCachedMaterial();
            // Fallbacks
            var fallbacks = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.EffectFallbacks();
            if (defines.FOG) {
                fallbacks.addFallback(1, "FOG");
            }
            core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.MaterialHelper.HandleFallbacksForShadows(defines, fallbacks);
            defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;
            //Attributes
            var attribs = [core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.VertexBuffer.PositionKind];
            if (defines.NORMAL) {
                attribs.push(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.VertexBuffer.NormalKind);
            }
            if (defines.UV1) {
                attribs.push(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.VertexBuffer.UVKind);
            }
            if (defines.UV2) {
                attribs.push(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.VertexBuffer.UV2Kind);
            }
            if (defines.VERTEXCOLOR) {
                attribs.push(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.VertexBuffer.ColorKind);
            }
            if (defines.TANGENT) {
                attribs.push(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.VertexBuffer.TangentKind);
            }
            core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.MaterialHelper.PrepareAttributesForInstances(attribs, defines);
            // Legacy browser patch
            var shaderName = "mrdlSliderBar";
            var join = defines.toString();
            var uniforms = [
                "world",
                "viewProjection",
                "cameraPosition",
                "_Radius_",
                "_Bevel_Front_",
                "_Bevel_Front_Stretch_",
                "_Bevel_Back_",
                "_Bevel_Back_Stretch_",
                "_Radius_Top_Left_",
                "_Radius_Top_Right_",
                "_Radius_Bottom_Left_",
                "_Radius_Bottom_Right_",
                "_Bulge_Enabled_",
                "_Bulge_Height_",
                "_Bulge_Radius_",
                "_Sun_Intensity_",
                "_Sun_Theta_",
                "_Sun_Phi_",
                "_Indirect_Diffuse_",
                "_Albedo_",
                "_Specular_",
                "_Shininess_",
                "_Sharpness_",
                "_Subsurface_",
                "_Left_Color_",
                "_Right_Color_",
                "_Reflection_",
                "_Front_Reflect_",
                "_Edge_Reflect_",
                "_Power_",
                "_Sky_Color_",
                "_Horizon_Color_",
                "_Ground_Color_",
                "_Horizon_Power_",
                "_Reflection_Map_",
                "_Indirect_Environment_",
                "_Width_",
                "_Fuzz_",
                "_Min_Fuzz_",
                "_Clip_Fade_",
                "_Hue_Shift_",
                "_Saturation_Shift_",
                "_Value_Shift_",
                "_Blob_Position_",
                "_Blob_Intensity_",
                "_Blob_Near_Size_",
                "_Blob_Far_Size_",
                "_Blob_Near_Distance_",
                "_Blob_Far_Distance_",
                "_Blob_Fade_Length_",
                "_Blob_Pulse_",
                "_Blob_Fade_",
                "_Blob_Texture_",
                "_Blob_Position_2_",
                "_Blob_Near_Size_2_",
                "_Blob_Pulse_2_",
                "_Blob_Fade_2_",
                "_Left_Index_Pos_",
                "_Right_Index_Pos_",
                "_Left_Index_Middle_Pos_",
                "_Right_Index_Middle_Pos_",
                "_Decal_",
                "_Decal_Scale_XY_",
                "_Decal_Front_Only_",
                "_Rim_Intensity_",
                "_Rim_Texture_",
                "_Rim_Hue_Shift_",
                "_Rim_Saturation_Shift_",
                "_Rim_Value_Shift_",
                "_Iridescence_Intensity_",
                "_Iridescence_Texture_",
                "Use_Global_Left_Index",
                "Use_Global_Right_Index",
                "Global_Left_Index_Tip_Position",
                "Global_Right_Index_Tip_Position",
                "Global_Left_Thumb_Tip_Position",
                "Global_Right_Thumb_Tip_Position",
                "Global_Left_Index_Middle_Position;",
                "Global_Right_Index_Middle_Position",
                "Global_Left_Index_Tip_Proximity",
                "Global_Right_Index_Tip_Proximity",
            ];
            var samplers = ["_Rim_Texture_", "_Iridescence_Texture_"];
            var uniformBuffers = new Array();
            core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.MaterialHelper.PrepareUniformsAndSamplersList({
                uniformsNames: uniforms,
                uniformBuffersNames: uniformBuffers,
                samplers: samplers,
                defines: defines,
                maxSimultaneousLights: 4,
            });
            subMesh.setEffect(scene.getEngine().createEffect(shaderName, {
                attributes: attribs,
                uniformsNames: uniforms,
                uniformBuffersNames: uniformBuffers,
                samplers: samplers,
                defines: join,
                fallbacks: fallbacks,
                onCompiled: this.onCompiled,
                onError: this.onError,
                indexParameters: { maxSimultaneousLights: 4 },
            }, engine), defines, this._materialContext);
        }
        if (!subMesh.effect || !subMesh.effect.isReady()) {
            return false;
        }
        defines._renderId = scene.getRenderId();
        subMesh.effect._wasPreviouslyReady = true;
        return true;
    };
    MRDLSliderBarMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) {
        var defines = subMesh.materialDefines;
        if (!defines) {
            return;
        }
        var effect = subMesh.effect;
        if (!effect) {
            return;
        }
        this._activeEffect = effect;
        // Matrices
        this.bindOnlyWorldMatrix(world);
        this._activeEffect.setMatrix("viewProjection", this.getScene().getTransformMatrix());
        this._activeEffect.setVector3("cameraPosition", this.getScene().activeCamera.position);
        // "Round Rect"
        this._activeEffect.setFloat("_Radius_", this.radius);
        this._activeEffect.setFloat("_Bevel_Front_", this.bevelFront);
        this._activeEffect.setFloat("_Bevel_Front_Stretch_", this.bevelFrontStretch);
        this._activeEffect.setFloat("_Bevel_Back_", this.bevelBack);
        this._activeEffect.setFloat("_Bevel_Back_Stretch_", this.bevelBackStretch);
        // "Radii Multipliers"
        this._activeEffect.setFloat("_Radius_Top_Left_", this.radiusTopLeft);
        this._activeEffect.setFloat("_Radius_Top_Right_", this.radiusTopRight);
        this._activeEffect.setFloat("_Radius_Bottom_Left_", this.radiusBottomLeft);
        this._activeEffect.setFloat("_Radius_Bottom_Right_", this.radiusBottomRight);
        // "Bulge"
        this._activeEffect.setFloat("_Bulge_Enabled_", this.bulgeEnabled ? 1.0 : 0.0);
        this._activeEffect.setFloat("_Bulge_Height_", this.bulgeHeight);
        this._activeEffect.setFloat("_Bulge_Radius_", this.bulgeRadius);
        // "Sun"
        this._activeEffect.setFloat("_Sun_Intensity_", this.sunIntensity);
        this._activeEffect.setFloat("_Sun_Theta_", this.sunTheta);
        this._activeEffect.setFloat("_Sun_Phi_", this.sunPhi);
        this._activeEffect.setFloat("_Indirect_Diffuse_", this.indirectDiffuse);
        // "Diffuse And Specular"
        this._activeEffect.setDirectColor4("_Albedo_", this.albedo);
        this._activeEffect.setFloat("_Specular_", this.specular);
        this._activeEffect.setFloat("_Shininess_", this.shininess);
        this._activeEffect.setFloat("_Sharpness_", this.sharpness);
        this._activeEffect.setFloat("_Subsurface_", this.subsurface);
        // "Gradient"
        this._activeEffect.setDirectColor4("_Left_Color_", this.leftGradientColor);
        this._activeEffect.setDirectColor4("_Right_Color_", this.rightGradientColor);
        // "Reflection"
        this._activeEffect.setFloat("_Reflection_", this.reflection);
        this._activeEffect.setFloat("_Front_Reflect_", this.frontReflect);
        this._activeEffect.setFloat("_Edge_Reflect_", this.edgeReflect);
        this._activeEffect.setFloat("_Power_", this.power);
        // "Sky Environment"
        //define SKY_ENABLED true;
        this._activeEffect.setDirectColor4("_Sky_Color_", this.skyColor);
        this._activeEffect.setDirectColor4("_Horizon_Color_", this.horizonColor);
        this._activeEffect.setDirectColor4("_Ground_Color_", this.groundColor);
        this._activeEffect.setFloat("_Horizon_Power_", this.horizonPower);
        // "Mapped Environment"
        //define ENV_ENABLE false;
        this._activeEffect.setTexture("_Reflection_Map_", new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Texture("", this.getScene()));
        this._activeEffect.setTexture("_Indirect_Environment_", new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Texture("", this.getScene()));
        // "FingerOcclusion"
        //define OCCLUSION_ENABLED false;
        this._activeEffect.setFloat("_Width_", this.width);
        this._activeEffect.setFloat("_Fuzz_", this.fuzz);
        this._activeEffect.setFloat("_Min_Fuzz_", this.minFuzz);
        this._activeEffect.setFloat("_Clip_Fade_", this.clipFade);
        // "View Based Color Shift"
        this._activeEffect.setFloat("_Hue_Shift_", this.hueShift);
        this._activeEffect.setFloat("_Saturation_Shift_", this.saturationShift);
        this._activeEffect.setFloat("_Value_Shift_", this.valueShift);
        // "Blob"
        //define BLOB_ENABLE false;
        this._activeEffect.setVector3("_Blob_Position_", this.blobPosition);
        this._activeEffect.setFloat("_Blob_Intensity_", this.blobIntensity);
        this._activeEffect.setFloat("_Blob_Near_Size_", this.blobNearSize);
        this._activeEffect.setFloat("_Blob_Far_Size_", this.blobFarSize);
        this._activeEffect.setFloat("_Blob_Near_Distance_", this.blobNearDistance);
        this._activeEffect.setFloat("_Blob_Far_Distance_", this.blobFarDistance);
        this._activeEffect.setFloat("_Blob_Fade_Length_", this.blobFadeLength);
        this._activeEffect.setFloat("_Blob_Pulse_", this.blobPulse);
        this._activeEffect.setFloat("_Blob_Fade_", this.blobFade);
        // "Blob Texture"
        this._activeEffect.setTexture("_Blob_Texture_", this.blobTexture);
        // "Blob 2"
        //define BLOB_ENABLE_2 true;
        this._activeEffect.setVector3("_Blob_Position_2_", this.blobPosition2);
        this._activeEffect.setFloat("_Blob_Near_Size_2_", this.blobNearSize2);
        this._activeEffect.setFloat("_Blob_Pulse_2_", this.blobPulse2);
        this._activeEffect.setFloat("_Blob_Fade_2_", this.blobFade2);
        // "Finger Positions"
        this._activeEffect.setVector3("_Left_Index_Pos_", this.leftIndexPosition);
        this._activeEffect.setVector3("_Right_Index_Pos_", this.rightIndexPosition);
        this._activeEffect.setVector3("_Left_Index_Middle_Pos_", this.leftIndexMiddlePosition);
        this._activeEffect.setVector3("_Right_Index_Middle_Pos_", this.rightIndexMiddlePosition);
        // "Decal Texture"
        //define DECAL_ENABLE false;
        this._activeEffect.setTexture("_Decal_", new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Texture("", this.getScene()));
        this._activeEffect.setVector2("_Decal_Scale_XY_", this.decalScaleXY);
        this._activeEffect.setFloat("_Decal_Front_Only_", this.decalFrontOnly ? 1.0 : 0.0);
        // "Rim Light"
        this._activeEffect.setFloat("_Rim_Intensity_", this.rimIntensity);
        this._activeEffect.setTexture("_Rim_Texture_", this._blueGradientTexture);
        this._activeEffect.setFloat("_Rim_Hue_Shift_", this.rimHueShift);
        this._activeEffect.setFloat("_Rim_Saturation_Shift_", this.rimSaturationShift);
        this._activeEffect.setFloat("_Rim_Value_Shift_", this.rimValueShift);
        // "Iridescence"
        //define IRIDESCENCE_ENABLED true;
        this._activeEffect.setFloat("_Iridescence_Intensity_", this.iridescenceIntensity);
        this._activeEffect.setTexture("_Iridescence_Texture_", this._blueGradientTexture);
        // Global inputs
        this._activeEffect.setFloat("Use_Global_Left_Index", this.useGlobalLeftIndex);
        this._activeEffect.setFloat("Use_Global_Right_Index", this.useGlobalRightIndex);
        this._activeEffect.setVector4("Global_Left_Index_Tip_Position", this.globalLeftIndexTipPosition);
        this._activeEffect.setVector4("Global_Right_Index_Tip_Position", this.globaRightIndexTipPosition);
        this._activeEffect.setVector4("Global_Left_Thumb_Tip_Position", this.globalLeftThumbTipPosition);
        this._activeEffect.setVector4("Global_Right_Thumb_Tip_Position", this.globalRightThumbTipPosition);
        this._activeEffect.setVector4("Global_Left_Index_Middle_Position", this.globalLeftIndexMiddlePosition);
        this._activeEffect.setVector4("Global_Right_Index_Middle_Position", this.globalRightIndexMiddlePosition);
        this._activeEffect.setFloat("Global_Left_Index_Tip_Proximity", this.globalLeftIndexTipProximity);
        this._activeEffect.setFloat("Global_Right_Index_Tip_Proximity", this.globalRightIndexTipProximity);
        this._afterBind(mesh, this._activeEffect);
    };
    /**
     * Get the list of animatables in the material.
     * @returns the list of animatables object used in the material
     */
    MRDLSliderBarMaterial.prototype.getAnimatables = function () {
        return [];
    };
    MRDLSliderBarMaterial.prototype.dispose = function (forceDisposeEffect) {
        _super.prototype.dispose.call(this, forceDisposeEffect);
    };
    MRDLSliderBarMaterial.prototype.clone = function (name) {
        var _this = this;
        return core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.SerializationHelper.Clone(function () { return new MRDLSliderBarMaterial(name, _this.getScene()); }, this);
    };
    MRDLSliderBarMaterial.prototype.serialize = function () {
        var serializationObject = _super.prototype.serialize.call(this);
        serializationObject.customType = "BABYLON.MRDLSliderBarMaterial";
        return serializationObject;
    };
    MRDLSliderBarMaterial.prototype.getClassName = function () {
        return "MRDLSliderBarMaterial";
    };
    // Statics
    MRDLSliderBarMaterial.Parse = function (source, scene, rootUrl) {
        return core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.SerializationHelper.Parse(function () { return new MRDLSliderBarMaterial(source.name, scene); }, source, scene, rootUrl);
    };
    /**
     * URL pointing to the texture used to define the coloring for the Iridescent Map effect.
     */
    MRDLSliderBarMaterial.BLUE_GRADIENT_TEXTURE_URL = "https://assets.babylonjs.com/meshes/MRTK/MRDL/mrtk-mrdl-blue-gradient.png";
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "radius", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "bevelFront", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "bevelFrontStretch", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "bevelBack", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "bevelBackStretch", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "radiusTopLeft", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "radiusTopRight", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "radiusBottomLeft", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "radiusBottomRight", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "bulgeEnabled", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "bulgeHeight", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "bulgeRadius", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "sunIntensity", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "sunTheta", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "sunPhi", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "indirectDiffuse", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "albedo", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "specular", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "shininess", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "sharpness", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "subsurface", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "leftGradientColor", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "rightGradientColor", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "reflection", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "frontReflect", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "edgeReflect", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "power", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "skyColor", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "horizonColor", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "groundColor", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "horizonPower", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "width", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "fuzz", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "minFuzz", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "clipFade", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "hueShift", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "saturationShift", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "valueShift", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "blobPosition", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "blobIntensity", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "blobNearSize", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "blobFarSize", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "blobNearDistance", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "blobFarDistance", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "blobFadeLength", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "blobPulse", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "blobFade", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "blobPosition2", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "blobNearSize2", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "blobPulse2", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "blobFade2", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "blobTexture", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "leftIndexPosition", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "rightIndexPosition", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "leftIndexMiddlePosition", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "rightIndexMiddlePosition", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "decalScaleXY", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "decalFrontOnly", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "rimIntensity", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "rimHueShift", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "rimSaturationShift", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "rimValueShift", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderBarMaterial.prototype, "iridescenceIntensity", void 0);
    return MRDLSliderBarMaterial;
}(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.PushMaterial));

(0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.RegisterClass)("BABYLON.GUI.MRDLSliderBarMaterial", MRDLSliderBarMaterial);


/***/ }),

/***/ "../../../lts/gui/dist/3D/materials/mrdl/mrdlSliderThumbMaterial.js":
/*!**************************************************************************!*\
  !*** ../../../lts/gui/dist/3D/materials/mrdl/mrdlSliderThumbMaterial.js ***!
  \**************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "MRDLSliderThumbMaterial": () => (/* binding */ MRDLSliderThumbMaterial)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Engines/constants */ "core/Misc/observable");
/* harmony import */ var core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _shaders_mrdlSliderThumb_fragment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./shaders/mrdlSliderThumb.fragment */ "../../../lts/gui/dist/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.js");
/* harmony import */ var _shaders_mrdlSliderThumb_vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./shaders/mrdlSliderThumb.vertex */ "../../../lts/gui/dist/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.js");














/** @hidden */
var MRDLSliderThumbMaterialDefines = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(MRDLSliderThumbMaterialDefines, _super);
    function MRDLSliderThumbMaterialDefines() {
        var _this = _super.call(this) || this;
        /*
            "SKY_ENABLED", "BLOB_ENABLE_2", "IRIDESCENCE_ENABLED"
        */
        _this.SKY_ENABLED = true;
        _this.BLOB_ENABLE_2 = true;
        _this.IRIDESCENCE_ENABLED = true;
        _this._needNormals = true;
        _this._needUVs = true;
        _this.rebuild();
        return _this;
    }
    return MRDLSliderThumbMaterialDefines;
}(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.MaterialDefines));
/**
 * Class used to render Slider Thumb material with MRDL
 */
var MRDLSliderThumbMaterial = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(MRDLSliderThumbMaterial, _super);
    function MRDLSliderThumbMaterial(name, scene) {
        var _this = _super.call(this, name, scene) || this;
        /**
         * Gets or sets the corner Radius on the slider thumb.
         */
        _this.radius = 0.157;
        /**
         * Gets or sets the Bevel Front on the slider thumb.
         */
        _this.bevelFront = 0.065;
        /**
         * Gets or sets the Bevel Front Stretch on the slider thumb.
         */
        _this.bevelFrontStretch = 0.077;
        /**
         * Gets or sets the Bevel Back on the slider thumb.
         */
        _this.bevelBack = 0.031;
        /**
         * Gets or sets the Bevel Back Stretch on the slider thumb.
         */
        _this.bevelBackStretch = 0;
        /**
         * Gets or sets the top left Radii Multiplier.
         */
        _this.radiusTopLeft = 1.0;
        /**
         * Gets or sets the top left Radii Multiplier.
         */
        _this.radiusTopRight = 1.0;
        /**
         * Gets or sets the top left Radii Multiplier.
         */
        _this.radiusBottomLeft = 1.0;
        /**
         * Gets or sets the top left Radii Multiplier.
         */
        _this.radiusBottomRight = 1.0;
        /**
         * Gets or sets whether Bulge is enabled.
         * Default is false.
         */
        _this.bulgeEnabled = false;
        /**
         * Gets or sets the Bulge Height.
         */
        _this.bulgeHeight = -0.323;
        /**
         * Gets or sets the Bulge Radius.
         */
        _this.bulgeRadius = 0.73;
        /**
         * Gets or sets the Sun Intensity.
         */
        _this.sunIntensity = 2;
        /**
         * Gets or sets the Sun Theta.
         */
        _this.sunTheta = 0.937;
        /**
         * Gets or sets the Sun Phi.
         */
        _this.sunPhi = 0.555;
        /**
         * Gets or sets the Indirect Diffuse.
         */
        _this.indirectDiffuse = 1;
        /**
         * Gets or sets the base albedo.
         */
        _this.albedo = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Color4(0.0117647, 0.505882, 0.996078, 1);
        /**
         * Gets or sets the Specular value.
         */
        _this.specular = 0;
        /**
         * Gets or sets the Shininess value.
         */
        _this.shininess = 10;
        /**
         * Gets or sets the Sharpness value.
         */
        _this.sharpness = 0;
        /**
         * Gets or sets the Subsurface value.
         */
        _this.subsurface = 0.31;
        /**
         * Gets or sets the left gradient color.
         */
        _this.leftGradientColor = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Color4(0.0117647, 0.505882, 0.996078, 1);
        /**
         * Gets or sets the right gradient color.
         */
        _this.rightGradientColor = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Color4(0.0117647, 0.505882, 0.996078, 1);
        /**
         * Gets or sets the reflection value.
         */
        _this.reflection = 0.749;
        /**
         * Gets or sets the front reflect value.
         */
        _this.frontReflect = 0;
        /**
         * Gets or sets the edge reflect value.
         */
        _this.edgeReflect = 0.09;
        /**
         * Gets or sets the power value.
         */
        _this.power = 8.1;
        /**
         * Gets or sets the sky color.
         */
        _this.skyColor = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Color4(0.0117647, 0.960784, 0.996078, 1);
        /**
         * Gets or sets the horizon color.
         */
        _this.horizonColor = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Color4(0.0117647, 0.333333, 0.996078, 1);
        /**
         * Gets or sets the ground color.
         */
        _this.groundColor = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Color4(0, 0.254902, 0.996078, 1);
        /**
         * Gets or sets the horizon power value.
         */
        _this.horizonPower = 1;
        /**
         * Gets or sets the finger occlusion width value.
         */
        _this.width = 0.02;
        /**
         * Gets or sets the finger occlusion fuzz value.
         */
        _this.fuzz = 0.5;
        /**
         * Gets or sets the minimum finger occlusion fuzz value.
         */
        _this.minFuzz = 0.001;
        /**
         * Gets or sets the finger occlusion clip fade value.
         */
        _this.clipFade = 0.01;
        /**
         * Gets or sets the hue shift value.
         */
        _this.hueShift = 0;
        /**
         * Gets or sets the saturation shift value.
         */
        _this.saturationShift = 0;
        /**
         * Gets or sets the value shift.
         */
        _this.valueShift = 0;
        /**
         * Gets or sets the position of the hover glow effect.
         */
        _this.blobPosition = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector3(0, 0, 0.1);
        /**
         * Gets or sets the intensity of the hover glow effect.
         */
        _this.blobIntensity = 0.5;
        /**
         * Gets or sets the near size of the hover glow effect.
         */
        _this.blobNearSize = 0.01;
        /**
         * Gets or sets the far size of the hover glow effect.
         */
        _this.blobFarSize = 0.03;
        /**
         * Gets or sets the distance considered "near" to the mesh, which controls the size of the hover glow effect (see blobNearSize).
         */
        _this.blobNearDistance = 0;
        /**
         * Gets or sets the distance considered "far" from the mesh, which controls the size of the hover glow effect (see blobFarSize).
         */
        _this.blobFarDistance = 0.08;
        /**
         * Gets or sets the length of the hover glow effect fade.
         */
        _this.blobFadeLength = 0.576;
        /**
         * Gets or sets the progress of the hover glow effect selection animation corresponding to the left pointer (0.0 - 1.0).
         */
        _this.blobPulse = 0;
        /**
         * Gets or sets the opacity of the hover glow effect corresponding to the left pointer (0.0 - 1.0). Default is 0.
         */
        _this.blobFade = 1;
        /**
         * Gets or sets the position of the hover glow effect.
         */
        _this.blobPosition2 = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector3(0.2, 0, 0.1);
        /**
         * Gets or sets the size of the hover glow effect when the right pointer is considered "near" to the mesh (see blobNearDistance).
         */
        _this.blobNearSize2 = 0.01;
        /**
         * Gets or sets the progress of the hover glow effect selection animation corresponding to the right pointer (0.0 - 1.0).
         */
        _this.blobPulse2 = 0;
        /**
         * Gets or sets the opacity of the hover glow effect corresponding to the right pointer (0.0 - 1.0). Default is 1.
         */
        _this.blobFade2 = 1;
        /**
         * Gets or sets the texture of the hover glow effect.
         */
        _this.blobTexture = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Texture("", _this.getScene());
        /**
         * Gets or sets the finger position for left index.
         */
        _this.leftIndexPosition = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector3(0, 0, 1);
        /**
         * Gets or sets the finger position for right index.
         */
        _this.rightIndexPosition = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector3(-1, -1, -1);
        /**
         * Gets or sets the finger position for left index middle position.
         */
        _this.leftIndexMiddlePosition = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector3(0, 0, 0);
        /**
         * Gets or sets the finger position for right index middle position.
         */
        _this.rightIndexMiddlePosition = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector3(0, 0, 0);
        /**
         * Gets or sets the Decal Scale for XY.
         */
        _this.decalScaleXY = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector2(1.5, 1.5);
        /**
         * Gets or sets decalFrontOnly
         * Default is true
         */
        _this.decalFrontOnly = true;
        /**
         * Gets or sets the Rim Light intensity.
         */
        _this.rimIntensity = 0.287;
        /**
         * Gets or sets the Rim Light hue shift value.
         */
        _this.rimHueShift = 0;
        /**
         * Gets or sets the Rim Light saturation shift value.
         */
        _this.rimSaturationShift = 0;
        /**
         * Gets or sets the Rim Light value shift.
         */
        _this.rimValueShift = -1;
        /**
         * Gets or sets the intensity of the iridescence effect.
         */
        _this.iridescenceIntensity = 0;
        /**
         * @hidden
         */
        _this.useGlobalLeftIndex = 1.0;
        /**
         * @hidden
         */
        _this.useGlobalRightIndex = 1.0;
        /**
         * @hidden
         */
        _this.globalLeftIndexTipProximity = 0.0;
        /**
         * @hidden
         */
        _this.globalRightIndexTipProximity = 0.0;
        /**
         * @hidden
         */
        _this.globalLeftIndexTipPosition = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector4(0.5, 0.0, -0.55, 1.0);
        /**
         * @hidden
         */
        _this.globaRightIndexTipPosition = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector4(0.0, 0.0, 0.0, 1.0);
        /**
         * @hidden
         */
        _this.globalLeftThumbTipPosition = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector4(0.5, 0.0, -0.55, 1.0);
        /**
         * @hidden
         */
        _this.globalRightThumbTipPosition = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector4(0.0, 0.0, 0.0, 1.0);
        /**
         * @hidden
         */
        _this.globalLeftIndexMiddlePosition = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector4(0.5, 0.0, -0.55, 1.0);
        /**
         * @hidden
         */
        _this.globalRightIndexMiddlePosition = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Vector4(0.0, 0.0, 0.0, 1.0);
        _this.alphaMode = core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Constants.ALPHA_DISABLE;
        _this.backFaceCulling = false;
        _this._blueGradientTexture = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Texture(MRDLSliderThumbMaterial.BLUE_GRADIENT_TEXTURE_URL, scene, true, false, core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Texture.NEAREST_SAMPLINGMODE);
        return _this;
    }
    MRDLSliderThumbMaterial.prototype.needAlphaBlending = function () {
        return false;
    };
    MRDLSliderThumbMaterial.prototype.needAlphaTesting = function () {
        return false;
    };
    MRDLSliderThumbMaterial.prototype.getAlphaTestTexture = function () {
        return null;
    };
    // Methods
    MRDLSliderThumbMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh) {
        if (this.isFrozen) {
            if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {
                return true;
            }
        }
        if (!subMesh.materialDefines) {
            subMesh.materialDefines = new MRDLSliderThumbMaterialDefines();
        }
        var defines = subMesh.materialDefines;
        var scene = this.getScene();
        if (this._isReadyForSubMesh(subMesh)) {
            return true;
        }
        var engine = scene.getEngine();
        // Attribs
        core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, false, false);
        // Get correct effect
        if (defines.isDirty) {
            defines.markAsProcessed();
            scene.resetCachedMaterial();
            // Fallbacks
            var fallbacks = new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.EffectFallbacks();
            if (defines.FOG) {
                fallbacks.addFallback(1, "FOG");
            }
            core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.MaterialHelper.HandleFallbacksForShadows(defines, fallbacks);
            defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;
            //Attributes
            var attribs = [core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.VertexBuffer.PositionKind];
            if (defines.NORMAL) {
                attribs.push(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.VertexBuffer.NormalKind);
            }
            if (defines.UV1) {
                attribs.push(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.VertexBuffer.UVKind);
            }
            if (defines.UV2) {
                attribs.push(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.VertexBuffer.UV2Kind);
            }
            if (defines.VERTEXCOLOR) {
                attribs.push(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.VertexBuffer.ColorKind);
            }
            if (defines.TANGENT) {
                attribs.push(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.VertexBuffer.TangentKind);
            }
            core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.MaterialHelper.PrepareAttributesForInstances(attribs, defines);
            // Legacy browser patch
            var shaderName = "mrdlSliderThumb";
            var join = defines.toString();
            var uniforms = [
                "world",
                "viewProjection",
                "cameraPosition",
                "_Radius_",
                "_Bevel_Front_",
                "_Bevel_Front_Stretch_",
                "_Bevel_Back_",
                "_Bevel_Back_Stretch_",
                "_Radius_Top_Left_",
                "_Radius_Top_Right_",
                "_Radius_Bottom_Left_",
                "_Radius_Bottom_Right_",
                "_Bulge_Enabled_",
                "_Bulge_Height_",
                "_Bulge_Radius_",
                "_Sun_Intensity_",
                "_Sun_Theta_",
                "_Sun_Phi_",
                "_Indirect_Diffuse_",
                "_Albedo_",
                "_Specular_",
                "_Shininess_",
                "_Sharpness_",
                "_Subsurface_",
                "_Left_Color_",
                "_Right_Color_",
                "_Reflection_",
                "_Front_Reflect_",
                "_Edge_Reflect_",
                "_Power_",
                "_Sky_Color_",
                "_Horizon_Color_",
                "_Ground_Color_",
                "_Horizon_Power_",
                "_Reflection_Map_",
                "_Indirect_Environment_",
                "_Width_",
                "_Fuzz_",
                "_Min_Fuzz_",
                "_Clip_Fade_",
                "_Hue_Shift_",
                "_Saturation_Shift_",
                "_Value_Shift_",
                "_Blob_Position_",
                "_Blob_Intensity_",
                "_Blob_Near_Size_",
                "_Blob_Far_Size_",
                "_Blob_Near_Distance_",
                "_Blob_Far_Distance_",
                "_Blob_Fade_Length_",
                "_Blob_Pulse_",
                "_Blob_Fade_",
                "_Blob_Texture_",
                "_Blob_Position_2_",
                "_Blob_Near_Size_2_",
                "_Blob_Pulse_2_",
                "_Blob_Fade_2_",
                "_Left_Index_Pos_",
                "_Right_Index_Pos_",
                "_Left_Index_Middle_Pos_",
                "_Right_Index_Middle_Pos_",
                "_Decal_",
                "_Decal_Scale_XY_",
                "_Decal_Front_Only_",
                "_Rim_Intensity_",
                "_Rim_Texture_",
                "_Rim_Hue_Shift_",
                "_Rim_Saturation_Shift_",
                "_Rim_Value_Shift_",
                "_Iridescence_Intensity_",
                "_Iridescence_Texture_",
                "Use_Global_Left_Index",
                "Use_Global_Right_Index",
                "Global_Left_Index_Tip_Position",
                "Global_Right_Index_Tip_Position",
                "Global_Left_Thumb_Tip_Position",
                "Global_Right_Thumb_Tip_Position",
                "Global_Left_Index_Middle_Position;",
                "Global_Right_Index_Middle_Position",
                "Global_Left_Index_Tip_Proximity",
                "Global_Right_Index_Tip_Proximity",
            ];
            var samplers = ["_Rim_Texture_", "_Iridescence_Texture_"];
            var uniformBuffers = new Array();
            core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.MaterialHelper.PrepareUniformsAndSamplersList({
                uniformsNames: uniforms,
                uniformBuffersNames: uniformBuffers,
                samplers: samplers,
                defines: defines,
                maxSimultaneousLights: 4,
            });
            subMesh.setEffect(scene.getEngine().createEffect(shaderName, {
                attributes: attribs,
                uniformsNames: uniforms,
                uniformBuffersNames: uniformBuffers,
                samplers: samplers,
                defines: join,
                fallbacks: fallbacks,
                onCompiled: this.onCompiled,
                onError: this.onError,
                indexParameters: { maxSimultaneousLights: 4 },
            }, engine), defines);
        }
        if (!subMesh.effect || !subMesh.effect.isReady()) {
            return false;
        }
        defines._renderId = scene.getRenderId();
        subMesh.effect._wasPreviouslyReady = true;
        return true;
    };
    MRDLSliderThumbMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) {
        var defines = subMesh.materialDefines;
        if (!defines) {
            return;
        }
        var effect = subMesh.effect;
        if (!effect) {
            return;
        }
        this._activeEffect = effect;
        // Matrices
        this.bindOnlyWorldMatrix(world);
        this._activeEffect.setMatrix("viewProjection", this.getScene().getTransformMatrix());
        this._activeEffect.setVector3("cameraPosition", this.getScene().activeCamera.position);
        // "Round Rect"
        this._activeEffect.setFloat("_Radius_", this.radius);
        this._activeEffect.setFloat("_Bevel_Front_", this.bevelFront);
        this._activeEffect.setFloat("_Bevel_Front_Stretch_", this.bevelFrontStretch);
        this._activeEffect.setFloat("_Bevel_Back_", this.bevelBack);
        this._activeEffect.setFloat("_Bevel_Back_Stretch_", this.bevelBackStretch);
        // "Radii Multipliers"
        this._activeEffect.setFloat("_Radius_Top_Left_", this.radiusTopLeft);
        this._activeEffect.setFloat("_Radius_Top_Right_", this.radiusTopRight);
        this._activeEffect.setFloat("_Radius_Bottom_Left_", this.radiusBottomLeft);
        this._activeEffect.setFloat("_Radius_Bottom_Right_", this.radiusBottomRight);
        // "Bulge"
        this._activeEffect.setFloat("_Bulge_Enabled_", this.bulgeEnabled ? 1.0 : 0.0);
        this._activeEffect.setFloat("_Bulge_Height_", this.bulgeHeight);
        this._activeEffect.setFloat("_Bulge_Radius_", this.bulgeRadius);
        // "Sun"
        this._activeEffect.setFloat("_Sun_Intensity_", this.sunIntensity);
        this._activeEffect.setFloat("_Sun_Theta_", this.sunTheta);
        this._activeEffect.setFloat("_Sun_Phi_", this.sunPhi);
        this._activeEffect.setFloat("_Indirect_Diffuse_", this.indirectDiffuse);
        // "Diffuse And Specular"
        this._activeEffect.setDirectColor4("_Albedo_", this.albedo);
        this._activeEffect.setFloat("_Specular_", this.specular);
        this._activeEffect.setFloat("_Shininess_", this.shininess);
        this._activeEffect.setFloat("_Sharpness_", this.sharpness);
        this._activeEffect.setFloat("_Subsurface_", this.subsurface);
        // "Gradient"
        this._activeEffect.setDirectColor4("_Left_Color_", this.leftGradientColor);
        this._activeEffect.setDirectColor4("_Right_Color_", this.rightGradientColor);
        // "Reflection"
        this._activeEffect.setFloat("_Reflection_", this.reflection);
        this._activeEffect.setFloat("_Front_Reflect_", this.frontReflect);
        this._activeEffect.setFloat("_Edge_Reflect_", this.edgeReflect);
        this._activeEffect.setFloat("_Power_", this.power);
        // "Sky Environment"
        //define SKY_ENABLED true;
        this._activeEffect.setDirectColor4("_Sky_Color_", this.skyColor);
        this._activeEffect.setDirectColor4("_Horizon_Color_", this.horizonColor);
        this._activeEffect.setDirectColor4("_Ground_Color_", this.groundColor);
        this._activeEffect.setFloat("_Horizon_Power_", this.horizonPower);
        // "Mapped Environment"
        //define ENV_ENABLE false;
        this._activeEffect.setTexture("_Reflection_Map_", new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Texture("", this.getScene()));
        this._activeEffect.setTexture("_Indirect_Environment_", new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Texture("", this.getScene()));
        // "FingerOcclusion"
        //define OCCLUSION_ENABLED false;
        this._activeEffect.setFloat("_Width_", this.width);
        this._activeEffect.setFloat("_Fuzz_", this.fuzz);
        this._activeEffect.setFloat("_Min_Fuzz_", this.minFuzz);
        this._activeEffect.setFloat("_Clip_Fade_", this.clipFade);
        // "View Based Color Shift"
        this._activeEffect.setFloat("_Hue_Shift_", this.hueShift);
        this._activeEffect.setFloat("_Saturation_Shift_", this.saturationShift);
        this._activeEffect.setFloat("_Value_Shift_", this.valueShift);
        // "Blob"
        //define BLOB_ENABLE false;
        this._activeEffect.setVector3("_Blob_Position_", this.blobPosition);
        this._activeEffect.setFloat("_Blob_Intensity_", this.blobIntensity);
        this._activeEffect.setFloat("_Blob_Near_Size_", this.blobNearSize);
        this._activeEffect.setFloat("_Blob_Far_Size_", this.blobFarSize);
        this._activeEffect.setFloat("_Blob_Near_Distance_", this.blobNearDistance);
        this._activeEffect.setFloat("_Blob_Far_Distance_", this.blobFarDistance);
        this._activeEffect.setFloat("_Blob_Fade_Length_", this.blobFadeLength);
        this._activeEffect.setFloat("_Blob_Pulse_", this.blobPulse);
        this._activeEffect.setFloat("_Blob_Fade_", this.blobFade);
        // "Blob Texture"
        this._activeEffect.setTexture("_Blob_Texture_", this.blobTexture);
        // "Blob 2"
        //define BLOB_ENABLE_2 true;
        this._activeEffect.setVector3("_Blob_Position_2_", this.blobPosition2);
        this._activeEffect.setFloat("_Blob_Near_Size_2_", this.blobNearSize2);
        this._activeEffect.setFloat("_Blob_Pulse_2_", this.blobPulse2);
        this._activeEffect.setFloat("_Blob_Fade_2_", this.blobFade2);
        // "Finger Positions"
        this._activeEffect.setVector3("_Left_Index_Pos_", this.leftIndexPosition);
        this._activeEffect.setVector3("_Right_Index_Pos_", this.rightIndexPosition);
        this._activeEffect.setVector3("_Left_Index_Middle_Pos_", this.leftIndexMiddlePosition);
        this._activeEffect.setVector3("_Right_Index_Middle_Pos_", this.rightIndexMiddlePosition);
        // "Decal Texture"
        //define DECAL_ENABLE false;
        this._activeEffect.setTexture("_Decal_", new core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Texture("", this.getScene()));
        this._activeEffect.setVector2("_Decal_Scale_XY_", this.decalScaleXY);
        this._activeEffect.setFloat("_Decal_Front_Only_", this.decalFrontOnly ? 1.0 : 0.0);
        // "Rim Light"
        this._activeEffect.setFloat("_Rim_Intensity_", this.rimIntensity);
        this._activeEffect.setTexture("_Rim_Texture_", this._blueGradientTexture);
        this._activeEffect.setFloat("_Rim_Hue_Shift_", this.rimHueShift);
        this._activeEffect.setFloat("_Rim_Saturation_Shift_", this.rimSaturationShift);
        this._activeEffect.setFloat("_Rim_Value_Shift_", this.rimValueShift);
        // "Iridescence"
        //define IRIDESCENCE_ENABLED true;
        this._activeEffect.setFloat("_Iridescence_Intensity_", this.iridescenceIntensity);
        this._activeEffect.setTexture("_Iridescence_Texture_", this._blueGradientTexture);
        // Global inputs
        this._activeEffect.setFloat("Use_Global_Left_Index", this.useGlobalLeftIndex);
        this._activeEffect.setFloat("Use_Global_Right_Index", this.useGlobalRightIndex);
        this._activeEffect.setVector4("Global_Left_Index_Tip_Position", this.globalLeftIndexTipPosition);
        this._activeEffect.setVector4("Global_Right_Index_Tip_Position", this.globaRightIndexTipPosition);
        this._activeEffect.setVector4("Global_Left_Thumb_Tip_Position", this.globalLeftThumbTipPosition);
        this._activeEffect.setVector4("Global_Right_Thumb_Tip_Position", this.globalRightThumbTipPosition);
        this._activeEffect.setVector4("Global_Left_Index_Middle_Position", this.globalLeftIndexMiddlePosition);
        this._activeEffect.setVector4("Global_Right_Index_Middle_Position", this.globalRightIndexMiddlePosition);
        this._activeEffect.setFloat("Global_Left_Index_Tip_Proximity", this.globalLeftIndexTipProximity);
        this._activeEffect.setFloat("Global_Right_Index_Tip_Proximity", this.globalRightIndexTipProximity);
        this._afterBind(mesh, this._activeEffect);
    };
    /**
     * Get the list of animatables in the material.
     * @returns the list of animatables object used in the material
     */
    MRDLSliderThumbMaterial.prototype.getAnimatables = function () {
        return [];
    };
    MRDLSliderThumbMaterial.prototype.dispose = function (forceDisposeEffect) {
        _super.prototype.dispose.call(this, forceDisposeEffect);
    };
    MRDLSliderThumbMaterial.prototype.clone = function (name) {
        var _this = this;
        return core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.SerializationHelper.Clone(function () { return new MRDLSliderThumbMaterial(name, _this.getScene()); }, this);
    };
    MRDLSliderThumbMaterial.prototype.serialize = function () {
        var serializationObject = _super.prototype.serialize.call(this);
        serializationObject.customType = "BABYLON.MRDLSliderThumbMaterial";
        return serializationObject;
    };
    MRDLSliderThumbMaterial.prototype.getClassName = function () {
        return "MRDLSliderThumbMaterial";
    };
    // Statics
    MRDLSliderThumbMaterial.Parse = function (source, scene, rootUrl) {
        return core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.SerializationHelper.Parse(function () { return new MRDLSliderThumbMaterial(source.name, scene); }, source, scene, rootUrl);
    };
    /**
     * URL pointing to the texture used to define the coloring for the Iridescent Map effect.
     */
    MRDLSliderThumbMaterial.BLUE_GRADIENT_TEXTURE_URL = "https://assets.babylonjs.com/meshes/MRTK/MRDL/mrtk-mrdl-blue-gradient.png";
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "radius", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "bevelFront", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "bevelFrontStretch", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "bevelBack", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "bevelBackStretch", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "radiusTopLeft", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "radiusTopRight", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "radiusBottomLeft", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "radiusBottomRight", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "bulgeEnabled", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "bulgeHeight", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "bulgeRadius", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "sunIntensity", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "sunTheta", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "sunPhi", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "indirectDiffuse", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "albedo", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "specular", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "shininess", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "sharpness", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "subsurface", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "leftGradientColor", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "rightGradientColor", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "reflection", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "frontReflect", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "edgeReflect", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "power", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "skyColor", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "horizonColor", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "groundColor", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "horizonPower", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "width", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "fuzz", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "minFuzz", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "clipFade", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "hueShift", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "saturationShift", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "valueShift", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "blobPosition", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "blobIntensity", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "blobNearSize", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "blobFarSize", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "blobNearDistance", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "blobFarDistance", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "blobFadeLength", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "blobPulse", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "blobFade", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "blobPosition2", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "blobNearSize2", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "blobPulse2", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "blobFade2", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "blobTexture", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "leftIndexPosition", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "rightIndexPosition", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "leftIndexMiddlePosition", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "rightIndexMiddlePosition", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "decalScaleXY", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "decalFrontOnly", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "rimIntensity", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "rimHueShift", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "rimSaturationShift", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "rimValueShift", void 0);
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
        (0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.serialize)()
    ], MRDLSliderThumbMaterial.prototype, "iridescenceIntensity", void 0);
    return MRDLSliderThumbMaterial;
}(core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.PushMaterial));

(0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.RegisterClass)("BABYLON.GUI.MRDLSliderThumbMaterial", MRDLSliderThumbMaterial);


/***/ }),

/***/ "../../../lts/gui/dist/3D/materials/mrdl/shaders/mrdlBackplate.fragment.js":
/*!*********************************************************************************!*\
  !*** ../../../lts/gui/dist/3D/materials/mrdl/shaders/mrdlBackplate.fragment.js ***!
  \*********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "mrdlBackplatePixelShader": () => (/* binding */ mrdlBackplatePixelShader)
/* harmony export */ });
/* harmony import */ var core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Engines/shaderStore */ "core/Misc/observable");
/* harmony import */ var core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);
// Do not edit.

var name = "mrdlBackplatePixelShader";
var shader = "uniform vec3 cameraPosition;\nvarying vec3 vPosition;\nvarying vec3 vNormal;\nvarying vec2 vUV;\nvarying vec3 vTangent;\nvarying vec3 vBinormal;\nvarying vec4 vExtra1;\nvarying vec4 vExtra2;\nuniform float _Radius_;\nuniform float _Line_Width_;\nuniform bool _Absolute_Sizes_;\nuniform float _Filter_Width_;\nuniform vec4 _Base_Color_;\nuniform vec4 _Line_Color_;\nuniform float _Radius_Top_Left_;\nuniform float _Radius_Top_Right_;\nuniform float _Radius_Bottom_Left_;\nuniform float _Radius_Bottom_Right_;\nuniform float _Rate_;\nuniform vec4 _Highlight_Color_;\nuniform float _Highlight_Width_;\nuniform vec4 _Highlight_Transform_;\nuniform float _Highlight_;\nuniform float _Iridescence_Intensity_;\nuniform float _Iridescence_Edge_Intensity_;\nuniform vec4 _Iridescence_Tint_;\nuniform sampler2D _Iridescent_Map_;\nuniform float _Angle_;\nuniform bool _Reflected_;\nuniform float _Frequency_;\nuniform float _Vertical_Offset_;\nuniform vec4 _Gradient_Color_;\nuniform vec4 _Top_Left_;\nuniform vec4 _Top_Right_;\nuniform vec4 _Bottom_Left_;\nuniform vec4 _Bottom_Right_;\nuniform float _Edge_Width_;\nuniform float _Edge_Power_;\nuniform float _Line_Gradient_Blend_;\nuniform float _Fade_Out_;\nvoid FastLinearTosRGB_B353(\nvec4 Linear,\nout vec4 sRGB)\n{\nsRGB.rgb=sqrt(clamp(Linear.rgb,0.0,1.0));\nsRGB.a=Linear.a;\n}\nvoid Round_Rect_Fragment_B332(\nfloat Radius,\nfloat Line_Width,\nvec4 Line_Color,\nfloat Filter_Width,\nvec2 UV,\nfloat Line_Visibility,\nvec4 Rect_Parms,\nvec4 Fill_Color,\nout vec4 Color)\n{\nfloat d=length(max(abs(UV)-Rect_Parms.xy,0.0));\nfloat dx=max(fwidth(d)*Filter_Width,0.00001);\nfloat g=min(Rect_Parms.z,Rect_Parms.w);\nfloat dgrad=max(fwidth(g)*Filter_Width,0.00001);\nfloat Inside_Rect=clamp(g/dgrad,0.0,1.0);\nfloat inner=clamp((d+dx*0.5-max(Radius-Line_Width,d-dx*0.5))/dx,0.0,1.0);\nColor=clamp(mix(Fill_Color,Line_Color,inner),0.0,1.0)*Inside_Rect;\n}\nvoid Iridescence_B343(\nvec3 Position,\nvec3 Normal,\nvec2 UV,\nvec3 Axis,\nvec3 Eye,\nvec4 Tint,\nsampler2D Texture,\nbool Reflected,\nfloat Frequency,\nfloat Vertical_Offset,\nout vec4 Color)\n{\nvec3 i=normalize(Position-Eye);\nvec3 r=reflect(i,Normal);\nfloat idota=dot(i,Axis);\nfloat idotr=dot(i,r);\nfloat x=Reflected ? idotr : idota;\nvec2 xy;\nxy.x=fract((x*Frequency+1.0)*0.5+UV.y*Vertical_Offset);\nxy.y=0.5;\nColor=texture(Texture,xy);\nColor.rgb*=Tint.rgb;\n}\nvoid Scale_RGB_B346(\nvec4 Color,\nfloat Scalar,\nout vec4 Result)\n{\nResult=vec4(Scalar,Scalar,Scalar,1)*Color;\n}\nvoid Scale_RGB_B344(\nfloat Scalar,\nvec4 Color,\nout vec4 Result)\n{\nResult=vec4(Scalar,Scalar,Scalar,1)*Color;\n}\nvoid Line_Fragment_B362(\nvec4 Base_Color,\nvec4 Highlight_Color,\nfloat Highlight_Width,\nvec3 Line_Vertex,\nfloat Highlight,\nout vec4 Line_Color)\n{\nfloat k2=1.0-clamp(abs(Line_Vertex.y/Highlight_Width),0.0,1.0);\nLine_Color=mix(Base_Color,Highlight_Color,Highlight*k2);\n}\nvoid Edge_B356(\nvec4 RectParms,\nfloat Radius,\nfloat Line_Width,\nvec2 UV,\nfloat Edge_Width,\nfloat Edge_Power,\nout float Result)\n{\nfloat d=length(max(abs(UV)-RectParms.xy,0.0));\nfloat edge=1.0-clamp((1.0-d/(Radius-Line_Width))/Edge_Width,0.0,1.0);\nResult=pow(edge,Edge_Power);\n}\nvoid Gradient_B355(\nvec4 Gradient_Color,\nvec4 Top_Left,\nvec4 Top_Right,\nvec4 Bottom_Left,\nvec4 Bottom_Right,\nvec2 UV,\nout vec4 Result)\n{\nvec3 top=Top_Left.rgb+(Top_Right.rgb-Top_Left.rgb)*UV.x;\nvec3 bottom=Bottom_Left.rgb+(Bottom_Right.rgb-Bottom_Left.rgb)*UV.x;\nResult.rgb=Gradient_Color.rgb*(bottom+(top-bottom)*UV.y);\nResult.a=1.0;\n}\nvoid main()\n{\nfloat X_Q338;\nfloat Y_Q338;\nfloat Z_Q338;\nfloat W_Q338;\nX_Q338=vExtra2.x;\nY_Q338=vExtra2.y;\nZ_Q338=vExtra2.z;\nW_Q338=vExtra2.w;\nvec4 Color_Q343;\n#if IRIDESCENCE_ENABLE\nIridescence_B343(vPosition,vNormal,vUV,vBinormal,cameraPosition,_Iridescence_Tint_,_Iridescent_Map_,_Reflected_,_Frequency_,_Vertical_Offset_,Color_Q343);\n#else\nColor_Q343=vec4(0,0,0,0);\n#endif\nvec4 Result_Q344;\nScale_RGB_B344(_Iridescence_Intensity_,Color_Q343,Result_Q344);\nvec4 Line_Color_Q362;\nLine_Fragment_B362(_Line_Color_,_Highlight_Color_,_Highlight_Width_,vTangent,_Highlight_,Line_Color_Q362);\nfloat Result_Q356;\n#if EDGE_ONLY\nEdge_B356(vExtra1,Z_Q338,W_Q338,vUV,_Edge_Width_,_Edge_Power_,Result_Q356);\n#else\nResult_Q356=1.0;\n#endif\nvec2 Vec2_Q339=vec2(X_Q338,Y_Q338);\nvec4 Result_Q355;\nGradient_B355(_Gradient_Color_,_Top_Left_,_Top_Right_,_Bottom_Left_,_Bottom_Right_,Vec2_Q339,Result_Q355);\nvec4 Linear_Q348;\nLinear_Q348.rgb=clamp(Result_Q355.rgb*Result_Q355.rgb,0.0,1.0);\nLinear_Q348.a=Result_Q355.a;\nvec4 Result_Q346;\nScale_RGB_B346(Linear_Q348,Result_Q356,Result_Q346);\nvec4 Sum_Q345=Result_Q346+Result_Q344;\nvec4 Color_At_T_Q347=mix(Line_Color_Q362,Result_Q346,_Line_Gradient_Blend_);\nvec4 Base_And_Iridescent_Q350;\nBase_And_Iridescent_Q350=_Base_Color_+vec4(Sum_Q345.rgb,0.0);\nvec4 Sum_Q349=Color_At_T_Q347+_Iridescence_Edge_Intensity_*Color_Q343;\nvec4 Result_Q351=Sum_Q349; Result_Q351.a=1.0;\nvec4 Color_Q332;\nRound_Rect_Fragment_B332(Z_Q338,W_Q338,Result_Q351,_Filter_Width_,vUV,1.0,vExtra1,Base_And_Iridescent_Q350,Color_Q332);\nvec4 Result_Q354=_Fade_Out_*Color_Q332;\nvec4 sRGB_Q353;\nFastLinearTosRGB_B353(Result_Q354,sRGB_Q353);\nvec4 Out_Color=sRGB_Q353;\nfloat Clip_Threshold=0.001;\nbool To_sRGB=false;\ngl_FragColor=Out_Color;\n}";
// Sideeffect
core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__.ShaderStore.ShadersStore[name] = shader;
/** @hidden */
var mrdlBackplatePixelShader = { name: name, shader: shader };


/***/ }),

/***/ "../../../lts/gui/dist/3D/materials/mrdl/shaders/mrdlBackplate.vertex.js":
/*!*******************************************************************************!*\
  !*** ../../../lts/gui/dist/3D/materials/mrdl/shaders/mrdlBackplate.vertex.js ***!
  \*******************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "mrdlBackplateVertexShader": () => (/* binding */ mrdlBackplateVertexShader)
/* harmony export */ });
/* harmony import */ var core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Engines/shaderStore */ "core/Misc/observable");
/* harmony import */ var core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);
// Do not edit.

var name = "mrdlBackplateVertexShader";
var shader = "uniform mat4 world;\nuniform mat4 viewProjection;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 tangent;\nuniform float _Radius_;\nuniform float _Line_Width_;\nuniform bool _Absolute_Sizes_;\nuniform float _Filter_Width_;\nuniform vec4 _Base_Color_;\nuniform vec4 _Line_Color_;\nuniform float _Radius_Top_Left_;\nuniform float _Radius_Top_Right_;\nuniform float _Radius_Bottom_Left_;\nuniform float _Radius_Bottom_Right_;\nuniform float _Rate_;\nuniform vec4 _Highlight_Color_;\nuniform float _Highlight_Width_;\nuniform vec4 _Highlight_Transform_;\nuniform float _Highlight_;\nuniform float _Iridescence_Intensity_;\nuniform float _Iridescence_Edge_Intensity_;\nuniform vec4 _Iridescence_Tint_;\nuniform sampler2D _Iridescent_Map_;\nuniform float _Angle_;\nuniform bool _Reflected_;\nuniform float _Frequency_;\nuniform float _Vertical_Offset_;\nuniform vec4 _Gradient_Color_;\nuniform vec4 _Top_Left_;\nuniform vec4 _Top_Right_;\nuniform vec4 _Bottom_Left_;\nuniform vec4 _Bottom_Right_;\nuniform float _Edge_Width_;\nuniform float _Edge_Power_;\nuniform float _Line_Gradient_Blend_;\nuniform float _Fade_Out_;\nvarying vec3 vPosition;\nvarying vec3 vNormal;\nvarying vec2 vUV;\nvarying vec3 vTangent;\nvarying vec3 vBinormal;\nvarying vec4 vExtra1;\nvarying vec4 vExtra2;\nvoid Object_To_World_Pos_B314(\nvec3 Pos_Object,\nout vec3 Pos_World)\n{\nPos_World=(world*vec4(Pos_Object,1.0)).xyz;\n}\nvoid Round_Rect_Vertex_B357(\nvec2 UV,\nfloat Radius,\nfloat Margin,\nfloat Anisotropy,\nfloat Gradient1,\nfloat Gradient2,\nvec3 Normal,\nvec4 Color_Scale_Translate,\nout vec2 Rect_UV,\nout vec4 Rect_Parms,\nout vec2 Scale_XY,\nout vec2 Line_UV,\nout vec2 Color_UV_Info)\n{\nScale_XY=vec2(Anisotropy,1.0);\nLine_UV=(UV-vec2(0.5,0.5));\nRect_UV=Line_UV*Scale_XY;\nRect_Parms.xy=Scale_XY*0.5-vec2(Radius,Radius)-vec2(Margin,Margin);\nRect_Parms.z=Gradient1; \nRect_Parms.w=Gradient2;\nColor_UV_Info=(Line_UV+vec2(0.5,0.5))*Color_Scale_Translate.xy+Color_Scale_Translate.zw;\n}\nvoid Line_Vertex_B333(\nvec2 Scale_XY,\nvec2 UV,\nfloat Time,\nfloat Rate,\nvec4 Highlight_Transform,\nout vec3 Line_Vertex)\n{\nfloat angle2=(Rate*Time)*2.0*3.1416;\nfloat sinAngle2=sin(angle2);\nfloat cosAngle2=cos(angle2);\nvec2 xformUV=UV*Highlight_Transform.xy+Highlight_Transform.zw;\nLine_Vertex.x=0.0;\nLine_Vertex.y=cosAngle2*xformUV.x-sinAngle2*xformUV.y;\nLine_Vertex.z=0.0; \n}\nvoid PickDir_B334(\nfloat Degrees,\nvec3 DirX,\nvec3 DirY,\nout vec3 Dir)\n{\nfloat a=Degrees*3.14159/180.0;\nDir=cos(a)*DirX+sin(a)*DirY;\n}\nvoid Move_Verts_B327(\nfloat Anisotropy,\nvec3 P,\nfloat Radius,\nout vec3 New_P,\nout vec2 New_UV,\nout float Radial_Gradient,\nout vec3 Radial_Dir)\n{\nvec2 UV=P.xy*2.0+0.5;\nvec2 center=clamp(UV,0.0,1.0);\nvec2 delta=UV-center;\nvec2 r2=2.0*vec2(Radius/Anisotropy,Radius);\nNew_UV=center+r2*(UV-2.0*center+0.5);\nNew_P=vec3(New_UV-0.5,P.z);\nRadial_Gradient=1.0-length(delta)*2.0;\nRadial_Dir=vec3(delta*r2,0.0);\n}\nvoid Pick_Radius_B336(\nfloat Radius,\nfloat Radius_Top_Left,\nfloat Radius_Top_Right,\nfloat Radius_Bottom_Left,\nfloat Radius_Bottom_Right,\nvec3 Position,\nout float Result)\n{\nbool whichY=Position.y>0.0;\nResult=Position.x<0.0 ? (whichY ? Radius_Top_Left : Radius_Bottom_Left) : (whichY ? Radius_Top_Right : Radius_Bottom_Right);\nResult*=Radius;\n}\nvoid Edge_AA_Vertex_B328(\nvec3 Position_World,\nvec3 Position_Object,\nvec3 Normal_Object,\nvec3 Eye,\nfloat Radial_Gradient,\nvec3 Radial_Dir,\nvec3 Tangent,\nout float Gradient1,\nout float Gradient2)\n{\nvec3 I=(Eye-Position_World);\nvec3 T=(vec4(Tangent,0.0)).xyz;\nfloat g=(dot(T,I)<0.0) ? 0.0 : 1.0;\nif (Normal_Object.z==0.0) { \nGradient1=Position_Object.z>0.0 ? g : 1.0;\nGradient2=Position_Object.z>0.0 ? 1.0 : g;\n} else {\nGradient1=g+(1.0-g)*(Radial_Gradient);\nGradient2=1.0;\n}\n}\nvoid Object_To_World_Dir_B330(\nvec3 Dir_Object,\nout vec3 Binormal_World,\nout vec3 Binormal_World_N,\nout float Binormal_Length)\n{\nBinormal_World=(world*vec4(Dir_Object,0.0)).xyz;\nBinormal_Length=length(Binormal_World);\nBinormal_World_N=Binormal_World/Binormal_Length;\n}\nvoid RelativeOrAbsoluteDetail_B341(\nfloat Nominal_Radius,\nfloat Nominal_LineWidth,\nbool Absolute_Measurements,\nfloat Height,\nout float Radius,\nout float Line_Width)\n{\nfloat scale=Absolute_Measurements ? 1.0/Height : 1.0;\nRadius=Nominal_Radius*scale;\nLine_Width=Nominal_LineWidth*scale;\n}\nvoid main()\n{\nvec3 Nrm_World_Q326;\nNrm_World_Q326=normalize((world*vec4(normal,0.0)).xyz);\nvec3 Tangent_World_Q329;\nvec3 Tangent_World_N_Q329;\nfloat Tangent_Length_Q329;\nTangent_World_Q329=(world*vec4(vec3(1,0,0),0.0)).xyz;\nTangent_Length_Q329=length(Tangent_World_Q329);\nTangent_World_N_Q329=Tangent_World_Q329/Tangent_Length_Q329;\nvec3 Binormal_World_Q330;\nvec3 Binormal_World_N_Q330;\nfloat Binormal_Length_Q330;\nObject_To_World_Dir_B330(vec3(0,1,0),Binormal_World_Q330,Binormal_World_N_Q330,Binormal_Length_Q330);\nfloat Radius_Q341;\nfloat Line_Width_Q341;\nRelativeOrAbsoluteDetail_B341(_Radius_,_Line_Width_,_Absolute_Sizes_,Binormal_Length_Q330,Radius_Q341,Line_Width_Q341);\nvec3 Dir_Q334;\nPickDir_B334(_Angle_,Tangent_World_N_Q329,Binormal_World_N_Q330,Dir_Q334);\nfloat Result_Q336;\nPick_Radius_B336(Radius_Q341,_Radius_Top_Left_,_Radius_Top_Right_,_Radius_Bottom_Left_,_Radius_Bottom_Right_,position,Result_Q336);\nfloat Anisotropy_Q331=Tangent_Length_Q329/Binormal_Length_Q330;\nvec4 Out_Color_Q337=vec4(Result_Q336,Line_Width_Q341,0,1);\nvec3 New_P_Q327;\nvec2 New_UV_Q327;\nfloat Radial_Gradient_Q327;\nvec3 Radial_Dir_Q327;\nMove_Verts_B327(Anisotropy_Q331,position,Result_Q336,New_P_Q327,New_UV_Q327,Radial_Gradient_Q327,Radial_Dir_Q327);\nvec3 Pos_World_Q314;\nObject_To_World_Pos_B314(New_P_Q327,Pos_World_Q314);\nfloat Gradient1_Q328;\nfloat Gradient2_Q328;\n#if SMOOTH_EDGES\nEdge_AA_Vertex_B328(Pos_World_Q314,position,normal,cameraPosition,Radial_Gradient_Q327,Radial_Dir_Q327,tangent,Gradient1_Q328,Gradient2_Q328);\n#else\nGradient1_Q328=1.0;\nGradient2_Q328=1.0;\n#endif\nvec2 Rect_UV_Q357;\nvec4 Rect_Parms_Q357;\nvec2 Scale_XY_Q357;\nvec2 Line_UV_Q357;\nvec2 Color_UV_Info_Q357;\nRound_Rect_Vertex_B357(New_UV_Q327,Result_Q336,0.0,Anisotropy_Q331,Gradient1_Q328,Gradient2_Q328,normal,vec4(1,1,0,0),Rect_UV_Q357,Rect_Parms_Q357,Scale_XY_Q357,Line_UV_Q357,Color_UV_Info_Q357);\nvec3 Line_Vertex_Q333;\nLine_Vertex_B333(Scale_XY_Q357,Line_UV_Q357,(20.0),_Rate_,_Highlight_Transform_,Line_Vertex_Q333);\nfloat X_Q359;\nfloat Y_Q359;\nX_Q359=Color_UV_Info_Q357.x;\nY_Q359=Color_UV_Info_Q357.y;\nvec4 Vec4_Q358=vec4(X_Q359,Y_Q359,Result_Q336,Line_Width_Q341);\nvec3 Position=Pos_World_Q314;\nvec3 Normal=Nrm_World_Q326;\nvec2 UV=Rect_UV_Q357;\nvec3 Tangent=Line_Vertex_Q333;\nvec3 Binormal=Dir_Q334;\nvec4 Color=Out_Color_Q337;\nvec4 Extra1=Rect_Parms_Q357;\nvec4 Extra2=Vec4_Q358;\nvec4 Extra3=vec4(0,0,0,0);\ngl_Position=viewProjection*vec4(Position,1);\nvPosition=Position;\nvNormal=Normal;\nvUV=UV;\nvTangent=Tangent;\nvBinormal=Binormal;\nvExtra1=Extra1;\nvExtra2=Extra2;\n}";
// Sideeffect
core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__.ShaderStore.ShadersStore[name] = shader;
/** @hidden */
var mrdlBackplateVertexShader = { name: name, shader: shader };


/***/ }),

/***/ "../../../lts/gui/dist/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.js":
/*!*********************************************************************************!*\
  !*** ../../../lts/gui/dist/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.js ***!
  \*********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "mrdlSliderBarPixelShader": () => (/* binding */ mrdlSliderBarPixelShader)
/* harmony export */ });
/* harmony import */ var core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Engines/shaderStore */ "core/Misc/observable");
/* harmony import */ var core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);
// Do not edit.

var name = "mrdlSliderBarPixelShader";
var shader = "uniform vec3 cameraPosition;\nvarying vec3 vPosition;\nvarying vec3 vNormal;\nvarying vec2 vUV;\nvarying vec3 vTangent;\nvarying vec3 vBinormal;\nvarying vec4 vColor;\nvarying vec4 vExtra1;\nvarying vec4 vExtra2;\nvarying vec4 vExtra3;\nuniform float _Radius_;\nuniform float _Bevel_Front_;\nuniform float _Bevel_Front_Stretch_;\nuniform float _Bevel_Back_;\nuniform float _Bevel_Back_Stretch_;\nuniform float _Radius_Top_Left_;\nuniform float _Radius_Top_Right_;\nuniform float _Radius_Bottom_Left_;\nuniform float _Radius_Bottom_Right_;\nuniform bool _Bulge_Enabled_;\nuniform float _Bulge_Height_;\nuniform float _Bulge_Radius_;\nuniform float _Sun_Intensity_;\nuniform float _Sun_Theta_;\nuniform float _Sun_Phi_;\nuniform float _Indirect_Diffuse_;\nuniform vec4 _Albedo_;\nuniform float _Specular_;\nuniform float _Shininess_;\nuniform float _Sharpness_;\nuniform float _Subsurface_;\nuniform vec4 _Left_Color_;\nuniform vec4 _Right_Color_;\nuniform float _Reflection_;\nuniform float _Front_Reflect_;\nuniform float _Edge_Reflect_;\nuniform float _Power_;\nuniform vec4 _Sky_Color_;\nuniform vec4 _Horizon_Color_;\nuniform vec4 _Ground_Color_;\nuniform float _Horizon_Power_;\nuniform sampler2D _Reflection_Map_;\nuniform sampler2D _Indirect_Environment_;\nuniform float _Width_;\nuniform float _Fuzz_;\nuniform float _Min_Fuzz_;\nuniform float _Clip_Fade_;\nuniform float _Hue_Shift_;\nuniform float _Saturation_Shift_;\nuniform float _Value_Shift_;\nuniform vec3 _Blob_Position_;\nuniform float _Blob_Intensity_;\nuniform float _Blob_Near_Size_;\nuniform float _Blob_Far_Size_;\nuniform float _Blob_Near_Distance_;\nuniform float _Blob_Far_Distance_;\nuniform float _Blob_Fade_Length_;\nuniform float _Blob_Pulse_;\nuniform float _Blob_Fade_;\nuniform sampler2D _Blob_Texture_;\nuniform vec3 _Blob_Position_2_;\nuniform float _Blob_Near_Size_2_;\nuniform float _Blob_Pulse_2_;\nuniform float _Blob_Fade_2_;\nuniform vec3 _Left_Index_Pos_;\nuniform vec3 _Right_Index_Pos_;\nuniform vec3 _Left_Index_Middle_Pos_;\nuniform vec3 _Right_Index_Middle_Pos_;\nuniform sampler2D _Decal_;\nuniform vec2 _Decal_Scale_XY_;\nuniform bool _Decal_Front_Only_;\nuniform float _Rim_Intensity_;\nuniform sampler2D _Rim_Texture_;\nuniform float _Rim_Hue_Shift_;\nuniform float _Rim_Saturation_Shift_;\nuniform float _Rim_Value_Shift_;\nuniform float _Iridescence_Intensity_;\nuniform sampler2D _Iridescence_Texture_;\nuniform bool Use_Global_Left_Index;\nuniform bool Use_Global_Right_Index;\nuniform vec4 Global_Left_Index_Tip_Position;\nuniform vec4 Global_Right_Index_Tip_Position;\nuniform vec4 Global_Left_Thumb_Tip_Position;\nuniform vec4 Global_Right_Thumb_Tip_Position;\nuniform vec4 Global_Left_Index_Middle_Position;\nuniform vec4 Global_Right_Index_Middle_Position;\nuniform float Global_Left_Index_Tip_Proximity;\nuniform float Global_Right_Index_Tip_Proximity;\nvoid Blob_Fragment_B30(\nsampler2D Blob_Texture,\nvec4 Blob_Info1,\nvec4 Blob_Info2,\nout vec4 Blob_Color)\n{\nfloat k1=dot(Blob_Info1.xy,Blob_Info1.xy);\nfloat k2=dot(Blob_Info2.xy,Blob_Info2.xy);\nvec3 closer=k1<k2 ? vec3(k1,Blob_Info1.z,Blob_Info1.w) : vec3(k2,Blob_Info2.z,Blob_Info2.w);\nBlob_Color=closer.z*texture(Blob_Texture,vec2(vec2(sqrt(closer.x),closer.y).x,1.0-vec2(sqrt(closer.x),closer.y).y))*clamp(1.0-closer.x,0.0,1.0);\n}\nvoid FastLinearTosRGB_B42(\nvec4 Linear,\nout vec4 sRGB)\n{\nsRGB.rgb=sqrt(clamp(Linear.rgb,0.0,1.0));\nsRGB.a=Linear.a;\n}\nvoid Scale_RGB_B59(\nvec4 Color,\nfloat Scalar,\nout vec4 Result)\n{\nResult=vec4(Scalar,Scalar,Scalar,1)*Color;\n}\nvoid Fragment_Main_B121(\nfloat Sun_Intensity,\nfloat Sun_Theta,\nfloat Sun_Phi,\nvec3 Normal,\nvec4 Albedo,\nfloat Fresnel_Reflect,\nfloat Shininess,\nvec3 Incident,\nvec4 Horizon_Color,\nvec4 Sky_Color,\nvec4 Ground_Color,\nfloat Indirect_Diffuse,\nfloat Specular,\nfloat Horizon_Power,\nfloat Reflection,\nvec4 Reflection_Sample,\nvec4 Indirect_Sample,\nfloat Sharpness,\nfloat SSS,\nfloat Subsurface,\nvec4 Translucence,\nvec4 Rim_Light,\nvec4 Iridescence,\nout vec4 Result)\n{\nfloat theta=Sun_Theta*2.0*3.14159;\nfloat phi=Sun_Phi*3.14159;\nvec3 lightDir= vec3(cos(phi)*cos(theta),sin(phi),cos(phi)*sin(theta));\nfloat NdotL=max(dot(lightDir,Normal),0.0);\nvec3 R=reflect(Incident,Normal);\nfloat RdotL=max(0.0,dot(R,lightDir));\nfloat specular=pow(RdotL,Shininess);\nspecular=mix(specular,smoothstep(0.495*Sharpness,1.0-0.495*Sharpness,specular),Sharpness);\nvec4 gi=mix(Ground_Color,Sky_Color,Normal.y*0.5+0.5);\nResult=((Sun_Intensity*NdotL+Indirect_Sample*Indirect_Diffuse+Translucence)*(1.0+SSS*Subsurface))*Albedo*(1.0-Fresnel_Reflect)+(Sun_Intensity*specular*Specular+Fresnel_Reflect*Reflection*Reflection_Sample)+Fresnel_Reflect*Rim_Light+Iridescence;\n}\nvoid Bulge_B79(\nbool Enabled,\nvec3 Normal,\nvec3 Tangent,\nfloat Bulge_Height,\nvec4 UV,\nfloat Bulge_Radius,\nvec3 ButtonN,\nout vec3 New_Normal)\n{\nvec2 xy=clamp(UV.xy*2.0,vec2(-1,-1),vec2(1,1));\nvec3 B=(cross(Normal,Tangent));\nfloat k=-clamp(1.0-length(xy)/Bulge_Radius,0.0,1.0)*Bulge_Height;\nk=sin(k*3.14159*0.5);\nk*=smoothstep(0.9998,0.9999,abs(dot(ButtonN,Normal)));\nNew_Normal=Normal*sqrt(1.0-k*k)+(xy.x*Tangent+xy.y*B)*k;\nNew_Normal=Enabled ? New_Normal : Normal;\n}\nvoid SSS_B77(\nvec3 ButtonN,\nvec3 Normal,\nvec3 Incident,\nout float Result)\n{\nfloat NdotI=abs(dot(Normal,Incident));\nfloat BdotI=abs(dot(ButtonN,Incident));\nResult=(abs(NdotI-BdotI)); \n}\nvoid FingerOcclusion_B67(\nfloat Width,\nfloat DistToCenter,\nfloat Fuzz,\nfloat Min_Fuzz,\nvec3 Position,\nvec3 Forward,\nvec3 Nearest,\nfloat Fade_Out,\nout float NotInShadow)\n{\nfloat d=dot((Nearest-Position),Forward);\nfloat sh=smoothstep(Width*0.5,Width*0.5+Fuzz*max(d,0.0)+Min_Fuzz,DistToCenter);\nNotInShadow=1.0-(1.0-sh)*smoothstep(-Fade_Out,0.0,d);\n}\nvoid FingerOcclusion_B68(\nfloat Width,\nfloat DistToCenter,\nfloat Fuzz,\nfloat Min_Fuzz,\nvec3 Position,\nvec3 Forward,\nvec3 Nearest,\nfloat Fade_Out,\nout float NotInShadow)\n{\nfloat d=dot((Nearest-Position),Forward);\nfloat sh=smoothstep(Width*0.5,Width*0.5+Fuzz*max(d,0.0)+Min_Fuzz,DistToCenter);\nNotInShadow=1.0-(1.0-sh)*smoothstep(-Fade_Out,0.0,d);\n}\nvoid Scale_Color_B91(\nvec4 Color,\nfloat Scalar,\nout vec4 Result)\n{\nResult=Scalar*Color;\n}\nvoid From_HSV_B73(\nfloat Hue,\nfloat Saturation,\nfloat Value,\nfloat Alpha,\nout vec4 Color)\n{\nvec4 K=vec4(1.0,2.0/3.0,1.0/3.0,3.0);\nvec3 p=abs(fract(vec3(Hue,Hue,Hue)+K.xyz)*6.0-K.www);\nColor.rgb=Value*mix(K.xxx,clamp(p-K.xxx,0.0,1.0),Saturation);\nColor.a=Alpha;\n}\nvoid Fast_Fresnel_B122(\nfloat Front_Reflect,\nfloat Edge_Reflect,\nfloat Power,\nvec3 Normal,\nvec3 Incident,\nout float Transmit,\nout float Reflect)\n{\nfloat d=max(-dot(Incident,Normal),0.0);\nReflect=Front_Reflect+(Edge_Reflect-Front_Reflect)*pow(.01-d,Power);\nTransmit=1.0-Reflect;\n}\nvoid Mapped_Environment_B51(\nsampler2D Reflected_Environment,\nsampler2D Indirect_Environment,\nvec3 Dir,\nout vec4 Reflected_Color,\nout vec4 Indirect_Diffuse)\n{\nReflected_Color=texture(Reflected_Environment,vec2(atan(Dir.z,Dir.x)/3.14159*0.5,asin(Dir.y)/3.14159+0.5));\nIndirect_Diffuse=texture(Indirect_Environment,vec2(atan(Dir.z,Dir.x)/3.14159*0.5,asin(Dir.y)/3.14159+0.5));\n}\nvec4 SampleEnv_Bid50(vec3 D,vec4 S,vec4 H,vec4 G,float exponent)\n{\nfloat k=pow(abs(D.y),exponent);\nvec4 C;\nif (D.y>0.0) {\nC=mix(H,S,k);\n} else {\nC=mix(H,G,k); \n}\nreturn C;\n}\nvoid Sky_Environment_B50(\nvec3 Normal,\nvec3 Reflected,\nvec4 Sky_Color,\nvec4 Horizon_Color,\nvec4 Ground_Color,\nfloat Horizon_Power,\nout vec4 Reflected_Color,\nout vec4 Indirect_Color)\n{\nReflected_Color=SampleEnv_Bid50(Reflected,Sky_Color,Horizon_Color,Ground_Color,Horizon_Power);\nIndirect_Color=mix(Ground_Color,Sky_Color,Normal.y*0.5+0.5);\n}\nvoid Min_Segment_Distance_B65(\nvec3 P0,\nvec3 P1,\nvec3 Q0,\nvec3 Q1,\nout vec3 NearP,\nout vec3 NearQ,\nout float Distance)\n{\nvec3 u=P1-P0;\nvec3 v=Q1-Q0;\nvec3 w=P0-Q0;\nfloat a=dot(u,u);\nfloat b=dot(u,v);\nfloat c=dot(v,v);\nfloat d=dot(u,w);\nfloat e=dot(v,w);\nfloat D=a*c-b*b;\nfloat sD=D;\nfloat tD=D;\nfloat sc,sN,tc,tN;\nif (D<0.00001) {\nsN=0.0;\nsD=1.0;\ntN=e;\ntD=c;\n} else {\nsN=(b*e-c*d);\ntN=(a*e-b*d);\nif (sN<0.0) {\nsN=0.0;\ntN=e;\ntD=c;\n} else if (sN>sD) {\nsN=sD;\ntN=e+b;\ntD=c;\n}\n}\nif (tN<0.0) {\ntN=0.0;\nif (-d<0.0) {\nsN=0.0;\n} else if (-d>a) {\nsN=sD;\n} else {\nsN=-d;\nsD=a;\n}\n} else if (tN>tD) {\ntN=tD;\nif ((-d+b)<0.0) {\nsN=0.0;\n} else if ((-d+b)>a) {\nsN=sD;\n} else {\nsN=(-d+b);\nsD=a;\n}\n}\nsc=abs(sN)<0.000001 ? 0.0 : sN/sD;\ntc=abs(tN)<0.000001 ? 0.0 : tN/tD;\nNearP=P0+sc*u;\nNearQ=Q0+tc*v;\nDistance=distance(NearP,NearQ);\n}\nvoid To_XYZ_B74(\nvec3 Vec3,\nout float X,\nout float Y,\nout float Z)\n{\nX=Vec3.x;\nY=Vec3.y;\nZ=Vec3.z;\n}\nvoid Finger_Positions_B64(\nvec3 Left_Index_Pos,\nvec3 Right_Index_Pos,\nvec3 Left_Index_Middle_Pos,\nvec3 Right_Index_Middle_Pos,\nout vec3 Left_Index,\nout vec3 Right_Index,\nout vec3 Left_Index_Middle,\nout vec3 Right_Index_Middle)\n{\nLeft_Index= (Use_Global_Left_Index ? Global_Left_Index_Tip_Position.xyz : Left_Index_Pos);\nRight_Index= (Use_Global_Right_Index ? Global_Right_Index_Tip_Position.xyz : Right_Index_Pos);\nLeft_Index_Middle= (Use_Global_Left_Index ? Global_Left_Index_Middle_Position.xyz : Left_Index_Middle_Pos);\nRight_Index_Middle= (Use_Global_Right_Index ? Global_Right_Index_Middle_Position.xyz : Right_Index_Middle_Pos);\n}\nvoid VaryHSV_B108(\nvec3 HSV_In,\nfloat Hue_Shift,\nfloat Saturation_Shift,\nfloat Value_Shift,\nout vec3 HSV_Out)\n{\nHSV_Out=vec3(fract(HSV_In.x+Hue_Shift),clamp(HSV_In.y+Saturation_Shift,0.0,1.0),clamp(HSV_In.z+Value_Shift,0.0,1.0));\n}\nvoid Remap_Range_B114(\nfloat In_Min,\nfloat In_Max,\nfloat Out_Min,\nfloat Out_Max,\nfloat In,\nout float Out)\n{\nOut=mix(Out_Min,Out_Max,clamp((In-In_Min)/(In_Max-In_Min),0.0,1.0));\n}\nvoid To_HSV_B75(\nvec4 Color,\nout float Hue,\nout float Saturation,\nout float Value,\nout float Alpha,\nout vec3 HSV)\n{\nvec4 K=vec4(0.0,-1.0/3.0,2.0/3.0,-1.0);\nvec4 p=Color.g<Color.b ? vec4(Color.bg,K.wz) : vec4(Color.gb,K.xy);\nvec4 q=Color.r<p.x ? vec4(p.xyw,Color.r) : vec4(Color.r,p.yzx);\nfloat d=q.x-min(q.w,q.y);\nfloat e=1.0e-10;\nHue=abs(q.z+(q.w-q.y)/(6.0*d+e));\nSaturation=d/(q.x+e);\nValue=q.x;\nAlpha=Color.a;\nHSV=vec3(Hue,Saturation,Value);\n}\nvoid Code_B110(\nfloat X,\nout float Result)\n{\nResult=(acos(X)/3.14159-0.5)*2.0;\n}\nvoid Rim_Light_B132(\nvec3 Front,\nvec3 Normal,\nvec3 Incident,\nfloat Rim_Intensity,\nsampler2D Texture,\nout vec4 Result)\n{\nvec3 R=reflect(Incident,Normal);\nfloat RdotF=dot(R,Front);\nfloat RdotL=sqrt(1.0-RdotF*RdotF);\nvec2 UV=vec2(R.y*0.5+0.5,0.5);\nvec4 Color=texture(Texture,UV);\nResult=Color;\n}\nvoid main()\n{\nvec4 Blob_Color_Q30;\n#if BLOB_ENABLE\nBlob_Fragment_B30(_Blob_Texture_,vExtra2,vExtra3,Blob_Color_Q30);\n#else\nBlob_Color_Q30=vec4(0,0,0,0);\n#endif\nvec3 Incident_Q39=normalize(vPosition-cameraPosition);\nvec3 Normalized_Q38=normalize(vNormal);\nvec3 Normalized_Q71=normalize(vTangent);\nvec4 Color_Q83;\n#if DECAL_ENABLE\nColor_Q83=texture(_Decal_,vUV);\n#else\nColor_Q83=vec4(0,0,0,0);\n#endif\nfloat X_Q90;\nfloat Y_Q90;\nfloat Z_Q90;\nfloat W_Q90;\nX_Q90=vExtra1.x;\nY_Q90=vExtra1.y;\nZ_Q90=vExtra1.z;\nW_Q90=vExtra1.w;\nvec4 Linear_Q43;\nLinear_Q43.rgb=clamp(_Sky_Color_.rgb*_Sky_Color_.rgb,0.0,1.0);\nLinear_Q43.a=_Sky_Color_.a;\nvec4 Linear_Q44;\nLinear_Q44.rgb=clamp(_Horizon_Color_.rgb*_Horizon_Color_.rgb,0.0,1.0);\nLinear_Q44.a=_Horizon_Color_.a;\nvec4 Linear_Q45;\nLinear_Q45.rgb=clamp(_Ground_Color_.rgb*_Ground_Color_.rgb,0.0,1.0);\nLinear_Q45.a=_Ground_Color_.a;\nvec3 Left_Index_Q64;\nvec3 Right_Index_Q64;\nvec3 Left_Index_Middle_Q64;\nvec3 Right_Index_Middle_Q64;\nFinger_Positions_B64(_Left_Index_Pos_,_Right_Index_Pos_,_Left_Index_Middle_Pos_,_Right_Index_Middle_Pos_,Left_Index_Q64,Right_Index_Q64,Left_Index_Middle_Q64,Right_Index_Middle_Q64);\nvec4 Linear_Q46;\nLinear_Q46.rgb=clamp(_Albedo_.rgb*_Albedo_.rgb,0.0,1.0);\nLinear_Q46.a=_Albedo_.a;\nvec3 Normalized_Q107=normalize(vBinormal);\nvec3 Incident_Q70=normalize(vPosition-cameraPosition);\nvec3 New_Normal_Q79;\nBulge_B79(_Bulge_Enabled_,Normalized_Q38,Normalized_Q71,_Bulge_Height_,vColor,_Bulge_Radius_,vBinormal,New_Normal_Q79);\nfloat Result_Q77;\nSSS_B77(vBinormal,New_Normal_Q79,Incident_Q39,Result_Q77);\nvec4 Result_Q91;\nScale_Color_B91(Color_Q83,X_Q90,Result_Q91);\nfloat Transmit_Q122;\nfloat Reflect_Q122;\nFast_Fresnel_B122(_Front_Reflect_,_Edge_Reflect_,_Power_,New_Normal_Q79,Incident_Q39,Transmit_Q122,Reflect_Q122);\nfloat Product_Q125=Y_Q90*Y_Q90;\nvec3 NearP_Q65;\nvec3 NearQ_Q65;\nfloat Distance_Q65;\nMin_Segment_Distance_B65(Left_Index_Q64,Left_Index_Middle_Q64,vPosition,cameraPosition,NearP_Q65,NearQ_Q65,Distance_Q65);\nvec3 NearP_Q63;\nvec3 NearQ_Q63;\nfloat Distance_Q63;\nMin_Segment_Distance_B65(Right_Index_Q64,Right_Index_Middle_Q64,vPosition,cameraPosition,NearP_Q63,NearQ_Q63,Distance_Q63);\nvec3 Reflected_Q47=reflect(Incident_Q39,New_Normal_Q79);\nvec4 Product_Q103=Linear_Q46*vec4(1,1,1,1);\nvec4 Result_Q132;\nRim_Light_B132(Normalized_Q107,Normalized_Q38,Incident_Q70,_Rim_Intensity_,_Rim_Texture_,Result_Q132);\nfloat Dot_Q72=dot(Incident_Q70, Normalized_Q71);\nfloat MaxAB_Q123=max(Reflect_Q122,Product_Q125);\nfloat NotInShadow_Q67;\n#if OCCLUSION_ENABLED\nFingerOcclusion_B67(_Width_,Distance_Q65,_Fuzz_,_Min_Fuzz_,vPosition,vBinormal,NearP_Q65,_Clip_Fade_,NotInShadow_Q67);\n#else\nNotInShadow_Q67=1.0;\n#endif\nfloat NotInShadow_Q68;\n#if OCCLUSION_ENABLED\nFingerOcclusion_B68(_Width_,Distance_Q63,_Fuzz_,_Min_Fuzz_,vPosition,vBinormal,NearP_Q63,_Clip_Fade_,NotInShadow_Q68);\n#else\nNotInShadow_Q68=1.0;\n#endif\nvec4 Reflected_Color_Q51;\nvec4 Indirect_Diffuse_Q51;\n#if ENV_ENABLE\nMapped_Environment_B51(_Reflection_Map_,_Indirect_Environment_,Reflected_Q47,Reflected_Color_Q51,Indirect_Diffuse_Q51);\n#else\nReflected_Color_Q51=vec4(0,0,0,1);\nIndirect_Diffuse_Q51=vec4(0,0,0,1);\n#endif\nvec4 Reflected_Color_Q50;\nvec4 Indirect_Color_Q50;\n#if SKY_ENABLED\nSky_Environment_B50(New_Normal_Q79,Reflected_Q47,Linear_Q43,Linear_Q44,Linear_Q45,_Horizon_Power_,Reflected_Color_Q50,Indirect_Color_Q50);\n#else\nReflected_Color_Q50=vec4(0,0,0,1);\nIndirect_Color_Q50=vec4(0,0,0,1);\n#endif\nfloat Hue_Q75;\nfloat Saturation_Q75;\nfloat Value_Q75;\nfloat Alpha_Q75;\nvec3 HSV_Q75;\nTo_HSV_B75(Product_Q103,Hue_Q75,Saturation_Q75,Value_Q75,Alpha_Q75,HSV_Q75);\nfloat Hue_Q127;\nfloat Saturation_Q127;\nfloat Value_Q127;\nfloat Alpha_Q127;\nvec3 HSV_Q127;\nTo_HSV_B75(Result_Q132,Hue_Q127,Saturation_Q127,Value_Q127,Alpha_Q127,HSV_Q127);\nfloat Result_Q110;\nCode_B110(Dot_Q72,Result_Q110);\nfloat AbsA_Q76=abs(Result_Q110);\nfloat MinAB_Q58=min(NotInShadow_Q67,NotInShadow_Q68);\nvec4 Sum_Q48=Reflected_Color_Q51+Reflected_Color_Q50;\nvec4 Sum_Q49=Indirect_Diffuse_Q51+Indirect_Color_Q50;\nvec3 HSV_Out_Q126;\nVaryHSV_B108(HSV_Q127,_Rim_Hue_Shift_,_Rim_Saturation_Shift_,_Rim_Value_Shift_,HSV_Out_Q126);\nfloat Out_Q114;\nRemap_Range_B114(-1.0,1.0,0.0,1.0,Result_Q110,Out_Q114);\nfloat Product_Q106;\nProduct_Q106=AbsA_Q76*_Hue_Shift_;\nfloat X_Q128;\nfloat Y_Q128;\nfloat Z_Q128;\nTo_XYZ_B74(HSV_Out_Q126,X_Q128,Y_Q128,Z_Q128);\nvec2 Vec2_Q112=vec2(Out_Q114,0.5);\nvec3 HSV_Out_Q108;\nVaryHSV_B108(HSV_Q75,Product_Q106,_Saturation_Shift_,_Value_Shift_,HSV_Out_Q108);\nvec4 Color_Q129;\nFrom_HSV_B73(X_Q128,Y_Q128,Z_Q128,0.0,Color_Q129);\nvec4 Color_Q111;\n#if IRIDESCENCE_ENABLED\nColor_Q111=texture(_Iridescence_Texture_,Vec2_Q112);\n#else\nColor_Q111=vec4(0,0,0,0);\n#endif\nfloat X_Q74;\nfloat Y_Q74;\nfloat Z_Q74;\nTo_XYZ_B74(HSV_Out_Q108,X_Q74,Y_Q74,Z_Q74);\nvec4 Result_Q131=_Rim_Intensity_*Color_Q129;\nvec4 Result_Q113=_Iridescence_Intensity_*Color_Q111;\nvec4 Color_Q73;\nFrom_HSV_B73(X_Q74,Y_Q74,Z_Q74,0.0,Color_Q73);\nvec4 Result_Q84=Result_Q91+(1.0-Result_Q91.a)*Color_Q73;\nvec4 Result_Q121;\nFragment_Main_B121(_Sun_Intensity_,_Sun_Theta_,_Sun_Phi_,New_Normal_Q79,Result_Q84,MaxAB_Q123,_Shininess_,Incident_Q39,_Horizon_Color_,_Sky_Color_,_Ground_Color_,_Indirect_Diffuse_,_Specular_,_Horizon_Power_,_Reflection_,Sum_Q48,Sum_Q49,_Sharpness_,Result_Q77,_Subsurface_,vec4(0,0,0,0),Result_Q131,Result_Q113,Result_Q121);\nvec4 Result_Q59;\nScale_RGB_B59(Result_Q121,MinAB_Q58,Result_Q59);\nvec4 sRGB_Q42;\nFastLinearTosRGB_B42(Result_Q59,sRGB_Q42);\nvec4 Result_Q31=Blob_Color_Q30+(1.0-Blob_Color_Q30.a)*sRGB_Q42;\nvec4 Result_Q40=Result_Q31; Result_Q40.a=1.0;\nvec4 Out_Color=Result_Q40;\nfloat Clip_Threshold=0.001;\nbool To_sRGB=false;\ngl_FragColor=Out_Color;\n}";
// Sideeffect
core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__.ShaderStore.ShadersStore[name] = shader;
/** @hidden */
var mrdlSliderBarPixelShader = { name: name, shader: shader };


/***/ }),

/***/ "../../../lts/gui/dist/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.js":
/*!*******************************************************************************!*\
  !*** ../../../lts/gui/dist/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.js ***!
  \*******************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "mrdlSliderBarVertexShader": () => (/* binding */ mrdlSliderBarVertexShader)
/* harmony export */ });
/* harmony import */ var core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Engines/shaderStore */ "core/Misc/observable");
/* harmony import */ var core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);
// Do not edit.

var name = "mrdlSliderBarVertexShader";
var shader = "uniform mat4 world;\nuniform mat4 viewProjection;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\n#ifdef TANGENT\nattribute vec3 tangent;\n#else\nconst vec3 tangent=vec3(0.);\n#endif\nuniform float _Radius_;\nuniform float _Bevel_Front_;\nuniform float _Bevel_Front_Stretch_;\nuniform float _Bevel_Back_;\nuniform float _Bevel_Back_Stretch_;\nuniform float _Radius_Top_Left_;\nuniform float _Radius_Top_Right_;\nuniform float _Radius_Bottom_Left_;\nuniform float _Radius_Bottom_Right_;\nuniform bool _Bulge_Enabled_;\nuniform float _Bulge_Height_;\nuniform float _Bulge_Radius_;\nuniform float _Sun_Intensity_;\nuniform float _Sun_Theta_;\nuniform float _Sun_Phi_;\nuniform float _Indirect_Diffuse_;\nuniform vec4 _Albedo_;\nuniform float _Specular_;\nuniform float _Shininess_;\nuniform float _Sharpness_;\nuniform float _Subsurface_;\nuniform vec4 _Left_Color_;\nuniform vec4 _Right_Color_;\nuniform float _Reflection_;\nuniform float _Front_Reflect_;\nuniform float _Edge_Reflect_;\nuniform float _Power_;\nuniform vec4 _Sky_Color_;\nuniform vec4 _Horizon_Color_;\nuniform vec4 _Ground_Color_;\nuniform float _Horizon_Power_;\nuniform sampler2D _Reflection_Map_;\nuniform sampler2D _Indirect_Environment_;\nuniform float _Width_;\nuniform float _Fuzz_;\nuniform float _Min_Fuzz_;\nuniform float _Clip_Fade_;\nuniform float _Hue_Shift_;\nuniform float _Saturation_Shift_;\nuniform float _Value_Shift_;\nuniform vec3 _Blob_Position_;\nuniform float _Blob_Intensity_;\nuniform float _Blob_Near_Size_;\nuniform float _Blob_Far_Size_;\nuniform float _Blob_Near_Distance_;\nuniform float _Blob_Far_Distance_;\nuniform float _Blob_Fade_Length_;\nuniform float _Blob_Pulse_;\nuniform float _Blob_Fade_;\nuniform sampler2D _Blob_Texture_;\nuniform vec3 _Blob_Position_2_;\nuniform float _Blob_Near_Size_2_;\nuniform float _Blob_Pulse_2_;\nuniform float _Blob_Fade_2_;\nuniform vec3 _Left_Index_Pos_;\nuniform vec3 _Right_Index_Pos_;\nuniform vec3 _Left_Index_Middle_Pos_;\nuniform vec3 _Right_Index_Middle_Pos_;\nuniform sampler2D _Decal_;\nuniform vec2 _Decal_Scale_XY_;\nuniform bool _Decal_Front_Only_;\nuniform float _Rim_Intensity_;\nuniform sampler2D _Rim_Texture_;\nuniform float _Rim_Hue_Shift_;\nuniform float _Rim_Saturation_Shift_;\nuniform float _Rim_Value_Shift_;\nuniform float _Iridescence_Intensity_;\nuniform sampler2D _Iridescence_Texture_;\nuniform bool Use_Global_Left_Index;\nuniform bool Use_Global_Right_Index;\nuniform vec4 Global_Left_Index_Tip_Position;\nuniform vec4 Global_Right_Index_Tip_Position;\nuniform vec4 Global_Left_Thumb_Tip_Position;\nuniform vec4 Global_Right_Thumb_Tip_Position;\nuniform float Global_Left_Index_Tip_Proximity;\nuniform float Global_Right_Index_Tip_Proximity;\nvarying vec3 vPosition;\nvarying vec3 vNormal;\nvarying vec2 vUV;\nvarying vec3 vTangent;\nvarying vec3 vBinormal;\nvarying vec4 vColor;\nvarying vec4 vExtra1;\nvarying vec4 vExtra2;\nvarying vec4 vExtra3;\nvoid Object_To_World_Pos_B12(\nvec3 Pos_Object,\nout vec3 Pos_World)\n{\nPos_World=(world*vec4(Pos_Object,1.0)).xyz;\n}\nvoid Object_To_World_Normal_B32(\nvec3 Nrm_Object,\nout vec3 Nrm_World)\n{\nNrm_World=(vec4(Nrm_Object,0.0)).xyz;\n}\nvoid Blob_Vertex_B23(\nvec3 Position,\nvec3 Normal,\nvec3 Tangent,\nvec3 Bitangent,\nvec3 Blob_Position,\nfloat Intensity,\nfloat Blob_Near_Size,\nfloat Blob_Far_Size,\nfloat Blob_Near_Distance,\nfloat Blob_Far_Distance,\nfloat Blob_Fade_Length,\nfloat Blob_Pulse,\nfloat Blob_Fade,\nout vec4 Blob_Info)\n{\nvec3 blob= (Use_Global_Left_Index ? Global_Left_Index_Tip_Position.xyz : Blob_Position);\nvec3 delta=blob-Position;\nfloat dist=dot(Normal,delta);\nfloat lerpValue=clamp((abs(dist)-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);\nfloat fadeValue=1.0-clamp((abs(dist)-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);\nfloat size=Blob_Near_Size+(Blob_Far_Size-Blob_Near_Size)*lerpValue;\nvec2 blobXY=vec2(dot(delta,Tangent),dot(delta,Bitangent))/(0.0001+size);\nfloat Fade=fadeValue*Intensity*Blob_Fade;\nfloat Distance=(lerpValue*0.5+0.5)*(1.0-Blob_Pulse);\nBlob_Info=vec4(blobXY.x,blobXY.y,Distance,Fade);\n}\nvoid Blob_Vertex_B24(\nvec3 Position,\nvec3 Normal,\nvec3 Tangent,\nvec3 Bitangent,\nvec3 Blob_Position,\nfloat Intensity,\nfloat Blob_Near_Size,\nfloat Blob_Far_Size,\nfloat Blob_Near_Distance,\nfloat Blob_Far_Distance,\nfloat Blob_Fade_Length,\nfloat Blob_Pulse,\nfloat Blob_Fade,\nout vec4 Blob_Info)\n{\nvec3 blob= (Use_Global_Right_Index ? Global_Right_Index_Tip_Position.xyz : Blob_Position);\nvec3 delta=blob-Position;\nfloat dist=dot(Normal,delta);\nfloat lerpValue=clamp((abs(dist)-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);\nfloat fadeValue=1.0-clamp((abs(dist)-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);\nfloat size=Blob_Near_Size+(Blob_Far_Size-Blob_Near_Size)*lerpValue;\nvec2 blobXY=vec2(dot(delta,Tangent),dot(delta,Bitangent))/(0.0001+size);\nfloat Fade=fadeValue*Intensity*Blob_Fade;\nfloat Distance=(lerpValue*0.5+0.5)*(1.0-Blob_Pulse);\nBlob_Info=vec4(blobXY.x,blobXY.y,Distance,Fade);\n}\nvoid Move_Verts_B130(\nfloat Anisotropy,\nvec3 P,\nfloat Radius,\nfloat Bevel,\nvec3 Normal_Object,\nfloat ScaleZ,\nfloat Stretch,\nout vec3 New_P,\nout vec2 New_UV,\nout float Radial_Gradient,\nout vec3 Radial_Dir,\nout vec3 New_Normal)\n{\nvec2 UV=P.xy*2.0+0.5;\nvec2 center=clamp(UV,0.0,1.0);\nvec2 delta=UV-center;\nfloat deltad=(length(delta)*2.0);\nfloat f=(Bevel+(Radius-Bevel)*Stretch)/Radius;\nfloat innerd=clamp(deltad*2.0,0.0,1.0);\nfloat outerd=clamp(deltad*2.0-1.0,0.0,1.0);\nfloat bevelAngle=outerd*3.14159*0.5;\nfloat sinb=sin(bevelAngle);\nfloat cosb=cos(bevelAngle);\nfloat beveld=(1.0-f)*innerd+f*sinb;\nfloat br=outerd;\nvec2 r2=2.0*vec2(Radius/Anisotropy,Radius);\nfloat dir=P.z<0.0001 ? 1.0 : -1.0;\nNew_UV=center+r2*((0.5-center)+normalize(delta+vec2(0.0,0.000001))*beveld*0.5);\nNew_P=vec3(New_UV-0.5,P.z+dir*(1.0-cosb)*Bevel*ScaleZ);\nRadial_Gradient=clamp((deltad-0.5)*2.0,0.0,1.0);\nRadial_Dir=vec3(delta*r2,0.0);\nvec3 beveledNormal=cosb*Normal_Object+sinb*vec3(delta.x,delta.y,0.0);\nNew_Normal=Normal_Object.z==0.0 ? Normal_Object : beveledNormal;\n}\nvoid Object_To_World_Dir_B60(\nvec3 Dir_Object,\nout vec3 Normal_World,\nout vec3 Normal_World_N,\nout float Normal_Length)\n{\nNormal_World=(world*vec4(Dir_Object,0.0)).xyz;\nNormal_Length=length(Normal_World);\nNormal_World_N=Normal_World/Normal_Length;\n}\nvoid To_XYZ_B78(\nvec3 Vec3,\nout float X,\nout float Y,\nout float Z)\n{\nX=Vec3.x;\nY=Vec3.y;\nZ=Vec3.z;\n}\nvoid Conditional_Float_B93(\nbool Which,\nfloat If_True,\nfloat If_False,\nout float Result)\n{\nResult=Which ? If_True : If_False;\n}\nvoid Object_To_World_Dir_B28(\nvec3 Dir_Object,\nout vec3 Binormal_World,\nout vec3 Binormal_World_N,\nout float Binormal_Length)\n{\nBinormal_World=(world*vec4(Dir_Object,0.0)).xyz;\nBinormal_Length=length(Binormal_World);\nBinormal_World_N=Binormal_World/Binormal_Length;\n}\nvoid Pick_Radius_B69(\nfloat Radius,\nfloat Radius_Top_Left,\nfloat Radius_Top_Right,\nfloat Radius_Bottom_Left,\nfloat Radius_Bottom_Right,\nvec3 Position,\nout float Result)\n{\nbool whichY=Position.y>0.0;\nResult=Position.x<0.0 ? (whichY ? Radius_Top_Left : Radius_Bottom_Left) : (whichY ? Radius_Top_Right : Radius_Bottom_Right);\nResult*=Radius;\n}\nvoid Conditional_Float_B36(\nbool Which,\nfloat If_True,\nfloat If_False,\nout float Result)\n{\nResult=Which ? If_True : If_False;\n}\nvoid Greater_Than_B37(\nfloat Left,\nfloat Right,\nout bool Not_Greater_Than,\nout bool Greater_Than)\n{\nGreater_Than=Left>Right;\nNot_Greater_Than=!Greater_Than;\n}\nvoid Remap_Range_B105(\nfloat In_Min,\nfloat In_Max,\nfloat Out_Min,\nfloat Out_Max,\nfloat In,\nout float Out)\n{\nOut=mix(Out_Min,Out_Max,clamp((In-In_Min)/(In_Max-In_Min),0.0,1.0));\n}\nvoid main()\n{\nvec2 XY_Q85;\nXY_Q85=(uv-vec2(0.5,0.5))*_Decal_Scale_XY_+vec2(0.5,0.5);\nvec3 Tangent_World_Q27;\nvec3 Tangent_World_N_Q27;\nfloat Tangent_Length_Q27;\nTangent_World_Q27=(world*vec4(vec3(1,0,0),0.0)).xyz;\nTangent_Length_Q27=length(Tangent_World_Q27);\nTangent_World_N_Q27=Tangent_World_Q27/Tangent_Length_Q27;\nvec3 Normal_World_Q60;\nvec3 Normal_World_N_Q60;\nfloat Normal_Length_Q60;\nObject_To_World_Dir_B60(vec3(0,0,1),Normal_World_Q60,Normal_World_N_Q60,Normal_Length_Q60);\nfloat X_Q78;\nfloat Y_Q78;\nfloat Z_Q78;\nTo_XYZ_B78(position,X_Q78,Y_Q78,Z_Q78);\nvec3 Nrm_World_Q26;\nNrm_World_Q26=normalize((world*vec4(normal,0.0)).xyz);\nvec3 Binormal_World_Q28;\nvec3 Binormal_World_N_Q28;\nfloat Binormal_Length_Q28;\nObject_To_World_Dir_B28(vec3(0,1,0),Binormal_World_Q28,Binormal_World_N_Q28,Binormal_Length_Q28);\nfloat Anisotropy_Q29=Tangent_Length_Q27/Binormal_Length_Q28;\nfloat Result_Q69;\nPick_Radius_B69(_Radius_,_Radius_Top_Left_,_Radius_Top_Right_,_Radius_Bottom_Left_,_Radius_Bottom_Right_,position,Result_Q69);\nfloat Anisotropy_Q53=Binormal_Length_Q28/Normal_Length_Q60;\nbool Not_Greater_Than_Q37;\nbool Greater_Than_Q37;\nGreater_Than_B37(Z_Q78,0.0,Not_Greater_Than_Q37,Greater_Than_Q37);\nvec4 Linear_Q101;\nLinear_Q101.rgb=clamp(_Left_Color_.rgb*_Left_Color_.rgb,0.0,1.0);\nLinear_Q101.a=_Left_Color_.a;\nvec4 Linear_Q102;\nLinear_Q102.rgb=clamp(_Right_Color_.rgb*_Right_Color_.rgb,0.0,1.0);\nLinear_Q102.a=_Right_Color_.a;\nvec3 Difference_Q61=vec3(0,0,0)-Normal_World_N_Q60;\nvec4 Out_Color_Q34=vec4(X_Q78,Y_Q78,Z_Q78,1);\nfloat Result_Q36;\nConditional_Float_B36(Greater_Than_Q37,_Bevel_Back_,_Bevel_Front_,Result_Q36);\nfloat Result_Q94;\nConditional_Float_B36(Greater_Than_Q37,_Bevel_Back_Stretch_,_Bevel_Front_Stretch_,Result_Q94);\nvec3 New_P_Q130;\nvec2 New_UV_Q130;\nfloat Radial_Gradient_Q130;\nvec3 Radial_Dir_Q130;\nvec3 New_Normal_Q130;\nMove_Verts_B130(Anisotropy_Q29,position,Result_Q69,Result_Q36,normal,Anisotropy_Q53,Result_Q94,New_P_Q130,New_UV_Q130,Radial_Gradient_Q130,Radial_Dir_Q130,New_Normal_Q130);\nfloat X_Q98;\nfloat Y_Q98;\nX_Q98=New_UV_Q130.x;\nY_Q98=New_UV_Q130.y;\nvec3 Pos_World_Q12;\nObject_To_World_Pos_B12(New_P_Q130,Pos_World_Q12);\nvec3 Nrm_World_Q32;\nObject_To_World_Normal_B32(New_Normal_Q130,Nrm_World_Q32);\nvec4 Blob_Info_Q23;\n#if BLOB_ENABLE\nBlob_Vertex_B23(Pos_World_Q12,Nrm_World_Q26,Tangent_World_N_Q27,Binormal_World_N_Q28,_Blob_Position_,_Blob_Intensity_,_Blob_Near_Size_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_,_Blob_Fade_,Blob_Info_Q23);\n#else\nBlob_Info_Q23=vec4(0,0,0,0);\n#endif\nvec4 Blob_Info_Q24;\n#if BLOB_ENABLE_2\nBlob_Vertex_B24(Pos_World_Q12,Nrm_World_Q26,Tangent_World_N_Q27,Binormal_World_N_Q28,_Blob_Position_2_,_Blob_Intensity_,_Blob_Near_Size_2_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_2_,_Blob_Fade_2_,Blob_Info_Q24);\n#else\nBlob_Info_Q24=vec4(0,0,0,0);\n#endif\nfloat Out_Q105;\nRemap_Range_B105(0.0,1.0,0.0,1.0,X_Q98,Out_Q105);\nfloat X_Q86;\nfloat Y_Q86;\nfloat Z_Q86;\nTo_XYZ_B78(Nrm_World_Q32,X_Q86,Y_Q86,Z_Q86);\nvec4 Color_At_T_Q97=mix(Linear_Q101,Linear_Q102,Out_Q105);\nfloat Minus_F_Q87=-Z_Q86;\nfloat R_Q99;\nfloat G_Q99;\nfloat B_Q99;\nfloat A_Q99;\nR_Q99=Color_At_T_Q97.r; G_Q99=Color_At_T_Q97.g; B_Q99=Color_At_T_Q97.b; A_Q99=Color_At_T_Q97.a;\nfloat ClampF_Q88=clamp(0.0,Minus_F_Q87,1.0);\nfloat Result_Q93;\nConditional_Float_B93(_Decal_Front_Only_,ClampF_Q88,1.0,Result_Q93);\nvec4 Vec4_Q89=vec4(Result_Q93,Radial_Gradient_Q130,G_Q99,B_Q99);\nvec3 Position=Pos_World_Q12;\nvec3 Normal=Nrm_World_Q32;\nvec2 UV=XY_Q85;\nvec3 Tangent=Tangent_World_N_Q27;\nvec3 Binormal=Difference_Q61;\nvec4 Color=Out_Color_Q34;\nvec4 Extra1=Vec4_Q89;\nvec4 Extra2=Blob_Info_Q23;\nvec4 Extra3=Blob_Info_Q24;\ngl_Position=viewProjection*vec4(Position,1);\nvPosition=Position;\nvNormal=Normal;\nvUV=UV;\nvTangent=Tangent;\nvBinormal=Binormal;\nvColor=Color;\nvExtra1=Extra1;\nvExtra2=Extra2;\nvExtra3=Extra3;\n}";
// Sideeffect
core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__.ShaderStore.ShadersStore[name] = shader;
/** @hidden */
var mrdlSliderBarVertexShader = { name: name, shader: shader };


/***/ }),

/***/ "../../../lts/gui/dist/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.js":
/*!***********************************************************************************!*\
  !*** ../../../lts/gui/dist/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.js ***!
  \***********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "mrdlSliderThumbPixelShader": () => (/* binding */ mrdlSliderThumbPixelShader)
/* harmony export */ });
/* harmony import */ var core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Engines/shaderStore */ "core/Misc/observable");
/* harmony import */ var core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);
// Do not edit.

var name = "mrdlSliderThumbPixelShader";
var shader = "uniform vec3 cameraPosition;\nvarying vec3 vPosition;\nvarying vec3 vNormal;\nvarying vec2 vUV;\nvarying vec3 vTangent;\nvarying vec3 vBinormal;\nvarying vec4 vColor;\nvarying vec4 vExtra1;\nvarying vec4 vExtra2;\nvarying vec4 vExtra3;\nuniform float _Radius_;\nuniform float _Bevel_Front_;\nuniform float _Bevel_Front_Stretch_;\nuniform float _Bevel_Back_;\nuniform float _Bevel_Back_Stretch_;\nuniform float _Radius_Top_Left_;\nuniform float _Radius_Top_Right_;\nuniform float _Radius_Bottom_Left_;\nuniform float _Radius_Bottom_Right_;\nuniform bool _Bulge_Enabled_;\nuniform float _Bulge_Height_;\nuniform float _Bulge_Radius_;\nuniform float _Sun_Intensity_;\nuniform float _Sun_Theta_;\nuniform float _Sun_Phi_;\nuniform float _Indirect_Diffuse_;\nuniform vec4 _Albedo_;\nuniform float _Specular_;\nuniform float _Shininess_;\nuniform float _Sharpness_;\nuniform float _Subsurface_;\nuniform vec4 _Left_Color_;\nuniform vec4 _Right_Color_;\nuniform float _Reflection_;\nuniform float _Front_Reflect_;\nuniform float _Edge_Reflect_;\nuniform float _Power_;\nuniform vec4 _Sky_Color_;\nuniform vec4 _Horizon_Color_;\nuniform vec4 _Ground_Color_;\nuniform float _Horizon_Power_;\nuniform sampler2D _Reflection_Map_;\nuniform sampler2D _Indirect_Environment_;\nuniform float _Width_;\nuniform float _Fuzz_;\nuniform float _Min_Fuzz_;\nuniform float _Clip_Fade_;\nuniform float _Hue_Shift_;\nuniform float _Saturation_Shift_;\nuniform float _Value_Shift_;\nuniform vec3 _Blob_Position_;\nuniform float _Blob_Intensity_;\nuniform float _Blob_Near_Size_;\nuniform float _Blob_Far_Size_;\nuniform float _Blob_Near_Distance_;\nuniform float _Blob_Far_Distance_;\nuniform float _Blob_Fade_Length_;\nuniform float _Blob_Pulse_;\nuniform float _Blob_Fade_;\nuniform sampler2D _Blob_Texture_;\nuniform vec3 _Blob_Position_2_;\nuniform float _Blob_Near_Size_2_;\nuniform float _Blob_Pulse_2_;\nuniform float _Blob_Fade_2_;\nuniform vec3 _Left_Index_Pos_;\nuniform vec3 _Right_Index_Pos_;\nuniform vec3 _Left_Index_Middle_Pos_;\nuniform vec3 _Right_Index_Middle_Pos_;\nuniform sampler2D _Decal_;\nuniform vec2 _Decal_Scale_XY_;\nuniform bool _Decal_Front_Only_;\nuniform float _Rim_Intensity_;\nuniform sampler2D _Rim_Texture_;\nuniform float _Rim_Hue_Shift_;\nuniform float _Rim_Saturation_Shift_;\nuniform float _Rim_Value_Shift_;\nuniform float _Iridescence_Intensity_;\nuniform sampler2D _Iridescence_Texture_;\nuniform bool Use_Global_Left_Index;\nuniform bool Use_Global_Right_Index;\nuniform vec4 Global_Left_Index_Tip_Position;\nuniform vec4 Global_Right_Index_Tip_Position;\nuniform vec4 Global_Left_Thumb_Tip_Position;\nuniform vec4 Global_Right_Thumb_Tip_Position;\nuniform vec4 Global_Left_Index_Middle_Position;\nuniform vec4 Global_Right_Index_Middle_Position;\nuniform float Global_Left_Index_Tip_Proximity;\nuniform float Global_Right_Index_Tip_Proximity;\nvoid Blob_Fragment_B180(\nsampler2D Blob_Texture,\nvec4 Blob_Info1,\nvec4 Blob_Info2,\nout vec4 Blob_Color)\n{\nfloat k1=dot(Blob_Info1.xy,Blob_Info1.xy);\nfloat k2=dot(Blob_Info2.xy,Blob_Info2.xy);\nvec3 closer=k1<k2 ? vec3(k1,Blob_Info1.z,Blob_Info1.w) : vec3(k2,Blob_Info2.z,Blob_Info2.w);\nBlob_Color=closer.z*texture(Blob_Texture,vec2(vec2(sqrt(closer.x),closer.y).x,1.0-vec2(sqrt(closer.x),closer.y).y))*clamp(1.0-closer.x,0.0,1.0);\n}\nvoid FastLinearTosRGB_B192(\nvec4 Linear,\nout vec4 sRGB)\n{\nsRGB.rgb=sqrt(clamp(Linear.rgb,0.0,1.0));\nsRGB.a=Linear.a;\n}\nvoid Scale_RGB_B209(\nvec4 Color,\nfloat Scalar,\nout vec4 Result)\n{\nResult=vec4(Scalar,Scalar,Scalar,1)*Color;\n}\nvoid Fragment_Main_B271(\nfloat Sun_Intensity,\nfloat Sun_Theta,\nfloat Sun_Phi,\nvec3 Normal,\nvec4 Albedo,\nfloat Fresnel_Reflect,\nfloat Shininess,\nvec3 Incident,\nvec4 Horizon_Color,\nvec4 Sky_Color,\nvec4 Ground_Color,\nfloat Indirect_Diffuse,\nfloat Specular,\nfloat Horizon_Power,\nfloat Reflection,\nvec4 Reflection_Sample,\nvec4 Indirect_Sample,\nfloat Sharpness,\nfloat SSS,\nfloat Subsurface,\nvec4 Translucence,\nvec4 Rim_Light,\nvec4 Iridescence,\nout vec4 Result)\n{\nfloat theta=Sun_Theta*2.0*3.14159;\nfloat phi=Sun_Phi*3.14159;\nvec3 lightDir= vec3(cos(phi)*cos(theta),sin(phi),cos(phi)*sin(theta));\nfloat NdotL=max(dot(lightDir,Normal),0.0);\nvec3 R=reflect(Incident,Normal);\nfloat RdotL=max(0.0,dot(R,lightDir));\nfloat specular=pow(RdotL,Shininess);\nspecular=mix(specular,smoothstep(0.495*Sharpness,1.0-0.495*Sharpness,specular),Sharpness);\nvec4 gi=mix(Ground_Color,Sky_Color,Normal.y*0.5+0.5);\nResult=((Sun_Intensity*NdotL+Indirect_Sample*Indirect_Diffuse+Translucence)*(1.0+SSS*Subsurface))*Albedo*(1.0-Fresnel_Reflect)+(Sun_Intensity*specular*Specular+Fresnel_Reflect*Reflection*Reflection_Sample)+Fresnel_Reflect*Rim_Light+Iridescence;\n}\nvoid Bulge_B229(\nbool Enabled,\nvec3 Normal,\nvec3 Tangent,\nfloat Bulge_Height,\nvec4 UV,\nfloat Bulge_Radius,\nvec3 ButtonN,\nout vec3 New_Normal)\n{\nvec2 xy=clamp(UV.xy*2.0,vec2(-1,-1),vec2(1,1));\nvec3 B=(cross(Normal,Tangent));\nfloat k=-clamp(1.0-length(xy)/Bulge_Radius,0.0,1.0)*Bulge_Height;\nk=sin(k*3.14159*0.5);\nk*=smoothstep(0.9998,0.9999,abs(dot(ButtonN,Normal)));\nNew_Normal=Normal*sqrt(1.0-k*k)+(xy.x*Tangent+xy.y*B)*k;\nNew_Normal=Enabled ? New_Normal : Normal;\n}\nvoid SSS_B227(\nvec3 ButtonN,\nvec3 Normal,\nvec3 Incident,\nout float Result)\n{\nfloat NdotI=abs(dot(Normal,Incident));\nfloat BdotI=abs(dot(ButtonN,Incident));\nResult=(abs(NdotI-BdotI)); \n}\nvoid FingerOcclusion_B217(\nfloat Width,\nfloat DistToCenter,\nfloat Fuzz,\nfloat Min_Fuzz,\nvec3 Position,\nvec3 Forward,\nvec3 Nearest,\nfloat Fade_Out,\nout float NotInShadow)\n{\nfloat d=dot((Nearest-Position),Forward);\nfloat sh=smoothstep(Width*0.5,Width*0.5+Fuzz*max(d,0.0)+Min_Fuzz,DistToCenter);\nNotInShadow=1.0-(1.0-sh)*smoothstep(-Fade_Out,0.0,d);\n}\nvoid FingerOcclusion_B218(\nfloat Width,\nfloat DistToCenter,\nfloat Fuzz,\nfloat Min_Fuzz,\nvec3 Position,\nvec3 Forward,\nvec3 Nearest,\nfloat Fade_Out,\nout float NotInShadow)\n{\nfloat d=dot((Nearest-Position),Forward);\nfloat sh=smoothstep(Width*0.5,Width*0.5+Fuzz*max(d,0.0)+Min_Fuzz,DistToCenter);\nNotInShadow=1.0-(1.0-sh)*smoothstep(-Fade_Out,0.0,d);\n}\nvoid Scale_Color_B241(\nvec4 Color,\nfloat Scalar,\nout vec4 Result)\n{\nResult=Scalar*Color;\n}\nvoid From_HSV_B223(\nfloat Hue,\nfloat Saturation,\nfloat Value,\nfloat Alpha,\nout vec4 Color)\n{\nvec4 K=vec4(1.0,2.0/3.0,1.0/3.0,3.0);\nvec3 p=abs(fract(vec3(Hue,Hue,Hue)+K.xyz)*6.0-K.www);\nColor.rgb=Value*mix(K.xxx,clamp(p-K.xxx,0.0,1.0),Saturation);\nColor.a=Alpha;\n}\nvoid Fast_Fresnel_B272(\nfloat Front_Reflect,\nfloat Edge_Reflect,\nfloat Power,\nvec3 Normal,\nvec3 Incident,\nout float Transmit,\nout float Reflect)\n{\nfloat d=max(-dot(Incident,Normal),0.0);\nReflect=Front_Reflect+(Edge_Reflect-Front_Reflect)*pow(1.0-d,Power);\nTransmit=1.0-Reflect;\n}\nvoid Mapped_Environment_B201(\nsampler2D Reflected_Environment,\nsampler2D Indirect_Environment,\nvec3 Dir,\nout vec4 Reflected_Color,\nout vec4 Indirect_Diffuse)\n{\nReflected_Color=texture(Reflected_Environment,vec2(atan(Dir.z,Dir.x)/3.14159*0.5,asin(Dir.y)/3.14159+0.5));\nIndirect_Diffuse=texture(Indirect_Environment,vec2(atan(Dir.z,Dir.x)/3.14159*0.5,asin(Dir.y)/3.14159+0.5));\n}\nvec4 SampleEnv_Bid200(vec3 D,vec4 S,vec4 H,vec4 G,float exponent)\n{\nfloat k=pow(abs(D.y),exponent);\nvec4 C;\nif (D.y>0.0) {\nC=mix(H,S,k);\n} else {\nC=mix(H,G,k); \n}\nreturn C;\n}\nvoid Sky_Environment_B200(\nvec3 Normal,\nvec3 Reflected,\nvec4 Sky_Color,\nvec4 Horizon_Color,\nvec4 Ground_Color,\nfloat Horizon_Power,\nout vec4 Reflected_Color,\nout vec4 Indirect_Color)\n{\nReflected_Color=SampleEnv_Bid200(Reflected,Sky_Color,Horizon_Color,Ground_Color,Horizon_Power);\nIndirect_Color=mix(Ground_Color,Sky_Color,Normal.y*0.5+0.5);\n}\nvoid Min_Segment_Distance_B215(\nvec3 P0,\nvec3 P1,\nvec3 Q0,\nvec3 Q1,\nout vec3 NearP,\nout vec3 NearQ,\nout float Distance)\n{\nvec3 u=P1-P0;\nvec3 v=Q1-Q0;\nvec3 w=P0-Q0;\nfloat a=dot(u,u);\nfloat b=dot(u,v);\nfloat c=dot(v,v);\nfloat d=dot(u,w);\nfloat e=dot(v,w);\nfloat D=a*c-b*b;\nfloat sD=D;\nfloat tD=D;\nfloat sc,sN,tc,tN;\nif (D<0.00001) {\nsN=0.0;\nsD=1.0;\ntN=e;\ntD=c;\n} else {\nsN=(b*e-c*d);\ntN=(a*e-b*d);\nif (sN<0.0) {\nsN=0.0;\ntN=e;\ntD=c;\n} else if (sN>sD) {\nsN=sD;\ntN=e+b;\ntD=c;\n}\n}\nif (tN<0.0) {\ntN=0.0;\nif (-d<0.0) {\nsN=0.0;\n} else if (-d>a) {\nsN=sD;\n} else {\nsN=-d;\nsD=a;\n}\n} else if (tN>tD) {\ntN=tD;\nif ((-d+b)<0.0) {\nsN=0.0;\n} else if ((-d+b)>a) {\nsN=sD;\n} else {\nsN=(-d+b);\nsD=a;\n}\n}\nsc=abs(sN)<0.000001 ? 0.0 : sN/sD;\ntc=abs(tN)<0.000001 ? 0.0 : tN/tD;\nNearP=P0+sc*u;\nNearQ=Q0+tc*v;\nDistance=distance(NearP,NearQ);\n}\nvoid To_XYZ_B224(\nvec3 Vec3,\nout float X,\nout float Y,\nout float Z)\n{\nX=Vec3.x;\nY=Vec3.y;\nZ=Vec3.z;\n}\nvoid Finger_Positions_B214(\nvec3 Left_Index_Pos,\nvec3 Right_Index_Pos,\nvec3 Left_Index_Middle_Pos,\nvec3 Right_Index_Middle_Pos,\nout vec3 Left_Index,\nout vec3 Right_Index,\nout vec3 Left_Index_Middle,\nout vec3 Right_Index_Middle)\n{\nLeft_Index= (Use_Global_Left_Index ? Global_Left_Index_Tip_Position.xyz : Left_Index_Pos);\nRight_Index= (Use_Global_Right_Index ? Global_Right_Index_Tip_Position.xyz : Right_Index_Pos);\nLeft_Index_Middle= (Use_Global_Left_Index ? Global_Left_Index_Middle_Position.xyz : Left_Index_Middle_Pos);\nRight_Index_Middle= (Use_Global_Right_Index ? Global_Right_Index_Middle_Position.xyz : Right_Index_Middle_Pos);\n}\nvoid VaryHSV_B258(\nvec3 HSV_In,\nfloat Hue_Shift,\nfloat Saturation_Shift,\nfloat Value_Shift,\nout vec3 HSV_Out)\n{\nHSV_Out=vec3(fract(HSV_In.x+Hue_Shift),clamp(HSV_In.y+Saturation_Shift,0.0,1.0),clamp(HSV_In.z+Value_Shift,0.0,1.0));\n}\nvoid Remap_Range_B264(\nfloat In_Min,\nfloat In_Max,\nfloat Out_Min,\nfloat Out_Max,\nfloat In,\nout float Out)\n{\nOut=mix(Out_Min,Out_Max,clamp((In-In_Min)/(In_Max-In_Min),0.0,1.0));\n}\nvoid To_HSV_B225(\nvec4 Color,\nout float Hue,\nout float Saturation,\nout float Value,\nout float Alpha,\nout vec3 HSV)\n{\nvec4 K=vec4(0.0,-1.0/3.0,2.0/3.0,-1.0);\nvec4 p=Color.g<Color.b ? vec4(Color.bg,K.wz) : vec4(Color.gb,K.xy);\nvec4 q=Color.r<p.x ? vec4(p.xyw,Color.r) : vec4(Color.r,p.yzx);\nfloat d=q.x-min(q.w,q.y);\nfloat e=1.0e-10;\nHue=abs(q.z+(q.w-q.y)/(6.0*d+e));\nSaturation=d/(q.x+e);\nValue=q.x;\nAlpha=Color.a;\nHSV=vec3(Hue,Saturation,Value);\n}\nvoid Code_B260(\nfloat X,\nout float Result)\n{\nResult=(acos(X)/3.14159-0.5)*2.0;\n}\nvoid Rim_Light_B282(\nvec3 Front,\nvec3 Normal,\nvec3 Incident,\nfloat Rim_Intensity,\nsampler2D Texture,\nout vec4 Result)\n{\nvec3 R=reflect(Incident,Normal);\nfloat RdotF=dot(R,Front);\nfloat RdotL=sqrt(1.0-RdotF*RdotF);\nvec2 UV=vec2(R.y*0.5+0.5,0.5);\nvec4 Color=texture(Texture,UV);\nResult=Color;\n}\nvoid main()\n{\nvec4 Blob_Color_Q180;\n#if BLOB_ENABLE\nBlob_Fragment_B180(_Blob_Texture_,vExtra2,vExtra3,Blob_Color_Q180);\n#else\nBlob_Color_Q180=vec4(0,0,0,0);\n#endif\nvec3 Incident_Q189=normalize(vPosition-cameraPosition);\nvec3 Normalized_Q188=normalize(vNormal);\nvec3 Normalized_Q221=normalize(vTangent);\nvec4 Color_Q233;\n#if DECAL_ENABLE\nColor_Q233=texture(_Decal_,vUV);\n#else\nColor_Q233=vec4(0,0,0,0);\n#endif\nfloat X_Q240;\nfloat Y_Q240;\nfloat Z_Q240;\nfloat W_Q240;\nX_Q240=vExtra1.x;\nY_Q240=vExtra1.y;\nZ_Q240=vExtra1.z;\nW_Q240=vExtra1.w;\nvec4 Linear_Q193;\nLinear_Q193.rgb=clamp(_Sky_Color_.rgb*_Sky_Color_.rgb,0.0,1.0);\nLinear_Q193.a=_Sky_Color_.a;\nvec4 Linear_Q194;\nLinear_Q194.rgb=clamp(_Horizon_Color_.rgb*_Horizon_Color_.rgb,0.0,1.0);\nLinear_Q194.a=_Horizon_Color_.a;\nvec4 Linear_Q195;\nLinear_Q195.rgb=clamp(_Ground_Color_.rgb*_Ground_Color_.rgb,0.0,1.0);\nLinear_Q195.a=_Ground_Color_.a;\nvec3 Left_Index_Q214;\nvec3 Right_Index_Q214;\nvec3 Left_Index_Middle_Q214;\nvec3 Right_Index_Middle_Q214;\nFinger_Positions_B214(_Left_Index_Pos_,_Right_Index_Pos_,_Left_Index_Middle_Pos_,_Right_Index_Middle_Pos_,Left_Index_Q214,Right_Index_Q214,Left_Index_Middle_Q214,Right_Index_Middle_Q214);\nvec4 Linear_Q196;\nLinear_Q196.rgb=clamp(_Albedo_.rgb*_Albedo_.rgb,0.0,1.0);\nLinear_Q196.a=_Albedo_.a;\nvec3 Normalized_Q257=normalize(vBinormal);\nvec3 Incident_Q220=normalize(vPosition-cameraPosition);\nvec3 New_Normal_Q229;\nBulge_B229(_Bulge_Enabled_,Normalized_Q188,Normalized_Q221,_Bulge_Height_,vColor,_Bulge_Radius_,vBinormal,New_Normal_Q229);\nfloat Result_Q227;\nSSS_B227(vBinormal,New_Normal_Q229,Incident_Q189,Result_Q227);\nvec4 Result_Q241;\nScale_Color_B241(Color_Q233,X_Q240,Result_Q241);\nfloat Transmit_Q272;\nfloat Reflect_Q272;\nFast_Fresnel_B272(_Front_Reflect_,_Edge_Reflect_,_Power_,New_Normal_Q229,Incident_Q189,Transmit_Q272,Reflect_Q272);\nfloat Product_Q275=Y_Q240*Y_Q240;\nvec3 NearP_Q215;\nvec3 NearQ_Q215;\nfloat Distance_Q215;\nMin_Segment_Distance_B215(Left_Index_Q214,Left_Index_Middle_Q214,vPosition,cameraPosition,NearP_Q215,NearQ_Q215,Distance_Q215);\nvec3 NearP_Q213;\nvec3 NearQ_Q213;\nfloat Distance_Q213;\nMin_Segment_Distance_B215(Right_Index_Q214,Right_Index_Middle_Q214,vPosition,cameraPosition,NearP_Q213,NearQ_Q213,Distance_Q213);\nvec3 Reflected_Q197=reflect(Incident_Q189,New_Normal_Q229);\nvec4 Product_Q253=Linear_Q196*vec4(1,1,1,1);\nvec4 Result_Q282;\nRim_Light_B282(Normalized_Q257,Normalized_Q188,Incident_Q220,_Rim_Intensity_,_Rim_Texture_,Result_Q282);\nfloat Dot_Q222=dot(Incident_Q220, Normalized_Q221);\nfloat MaxAB_Q273=max(Reflect_Q272,Product_Q275);\nfloat NotInShadow_Q217;\n#if OCCLUSION_ENABLED\nFingerOcclusion_B217(_Width_,Distance_Q215,_Fuzz_,_Min_Fuzz_,vPosition,vBinormal,NearP_Q215,_Clip_Fade_,NotInShadow_Q217);\n#else\nNotInShadow_Q217=1.0;\n#endif\nfloat NotInShadow_Q218;\n#if OCCLUSION_ENABLED\nFingerOcclusion_B218(_Width_,Distance_Q213,_Fuzz_,_Min_Fuzz_,vPosition,vBinormal,NearP_Q213,_Clip_Fade_,NotInShadow_Q218);\n#else\nNotInShadow_Q218=1.0;\n#endif\nvec4 Reflected_Color_Q201;\nvec4 Indirect_Diffuse_Q201;\n#if ENV_ENABLE\nMapped_Environment_B201(_Reflection_Map_,_Indirect_Environment_,Reflected_Q197,Reflected_Color_Q201,Indirect_Diffuse_Q201);\n#else\nReflected_Color_Q201=vec4(0,0,0,1);\nIndirect_Diffuse_Q201=vec4(0,0,0,1);\n#endif\nvec4 Reflected_Color_Q200;\nvec4 Indirect_Color_Q200;\n#if SKY_ENABLED\nSky_Environment_B200(New_Normal_Q229,Reflected_Q197,Linear_Q193,Linear_Q194,Linear_Q195,_Horizon_Power_,Reflected_Color_Q200,Indirect_Color_Q200);\n#else\nReflected_Color_Q200=vec4(0,0,0,1);\nIndirect_Color_Q200=vec4(0,0,0,1);\n#endif\nfloat Hue_Q225;\nfloat Saturation_Q225;\nfloat Value_Q225;\nfloat Alpha_Q225;\nvec3 HSV_Q225;\nTo_HSV_B225(Product_Q253,Hue_Q225,Saturation_Q225,Value_Q225,Alpha_Q225,HSV_Q225);\nfloat Hue_Q277;\nfloat Saturation_Q277;\nfloat Value_Q277;\nfloat Alpha_Q277;\nvec3 HSV_Q277;\nTo_HSV_B225(Result_Q282,Hue_Q277,Saturation_Q277,Value_Q277,Alpha_Q277,HSV_Q277);\nfloat Result_Q260;\nCode_B260(Dot_Q222,Result_Q260);\nfloat AbsA_Q226=abs(Result_Q260);\nfloat MinAB_Q208=min(NotInShadow_Q217,NotInShadow_Q218);\nvec4 Sum_Q198=Reflected_Color_Q201+Reflected_Color_Q200;\nvec4 Sum_Q199=Indirect_Diffuse_Q201+Indirect_Color_Q200;\nvec3 HSV_Out_Q276;\nVaryHSV_B258(HSV_Q277,_Rim_Hue_Shift_,_Rim_Saturation_Shift_,_Rim_Value_Shift_,HSV_Out_Q276);\nfloat Out_Q264;\nRemap_Range_B264(-1.0,1.0,0.0,1.0,Result_Q260,Out_Q264);\nfloat Product_Q256;\nProduct_Q256=AbsA_Q226*_Hue_Shift_;\nfloat X_Q278;\nfloat Y_Q278;\nfloat Z_Q278;\nTo_XYZ_B224(HSV_Out_Q276,X_Q278,Y_Q278,Z_Q278);\nvec2 Vec2_Q262=vec2(Out_Q264,0.5);\nvec3 HSV_Out_Q258;\nVaryHSV_B258(HSV_Q225,Product_Q256,_Saturation_Shift_,_Value_Shift_,HSV_Out_Q258);\nvec4 Color_Q279;\nFrom_HSV_B223(X_Q278,Y_Q278,Z_Q278,0.0,Color_Q279);\nvec4 Color_Q261;\n#if IRIDESCENCE_ENABLED\nColor_Q261=texture(_Iridescence_Texture_,Vec2_Q262);\n#else\nColor_Q261=vec4(0,0,0,0);\n#endif\nfloat X_Q224;\nfloat Y_Q224;\nfloat Z_Q224;\nTo_XYZ_B224(HSV_Out_Q258,X_Q224,Y_Q224,Z_Q224);\nvec4 Result_Q281=_Rim_Intensity_*Color_Q279;\nvec4 Result_Q263=_Iridescence_Intensity_*Color_Q261;\nvec4 Color_Q223;\nFrom_HSV_B223(X_Q224,Y_Q224,Z_Q224,0.0,Color_Q223);\nvec4 Result_Q234=Result_Q241+(1.0-Result_Q241.a)*Color_Q223;\nvec4 Result_Q271;\nFragment_Main_B271(_Sun_Intensity_,_Sun_Theta_,_Sun_Phi_,New_Normal_Q229,Result_Q234,MaxAB_Q273,_Shininess_,Incident_Q189,_Horizon_Color_,_Sky_Color_,_Ground_Color_,_Indirect_Diffuse_,_Specular_,_Horizon_Power_,_Reflection_,Sum_Q198,Sum_Q199,_Sharpness_,Result_Q227,_Subsurface_,vec4(0,0,0,0),Result_Q281,Result_Q263,Result_Q271);\nvec4 Result_Q209;\nScale_RGB_B209(Result_Q271,MinAB_Q208,Result_Q209);\nvec4 sRGB_Q192;\nFastLinearTosRGB_B192(Result_Q209,sRGB_Q192);\nvec4 Result_Q181=Blob_Color_Q180+(1.0-Blob_Color_Q180.a)*sRGB_Q192;\nvec4 Result_Q190=Result_Q181; Result_Q190.a=1.0;\nvec4 Out_Color=Result_Q190;\nfloat Clip_Threshold=0.001;\nbool To_sRGB=false;\ngl_FragColor=Out_Color;\n}";
// Sideeffect
core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__.ShaderStore.ShadersStore[name] = shader;
/** @hidden */
var mrdlSliderThumbPixelShader = { name: name, shader: shader };


/***/ }),

/***/ "../../../lts/gui/dist/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.js":
/*!*********************************************************************************!*\
  !*** ../../../lts/gui/dist/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.js ***!
  \*********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "mrdlSliderThumbVertexShader": () => (/* binding */ mrdlSliderThumbVertexShader)
/* harmony export */ });
/* harmony import */ var core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core/Engines/shaderStore */ "core/Misc/observable");
/* harmony import */ var core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__);
// Do not edit.

var name = "mrdlSliderThumbVertexShader";
var shader = "uniform mat4 world;\nuniform mat4 viewProjection;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\n#ifdef TANGENT\nattribute vec3 tangent;\n#else\nconst vec3 tangent=vec3(0.);\n#endif\nuniform float _Radius_;\nuniform float _Bevel_Front_;\nuniform float _Bevel_Front_Stretch_;\nuniform float _Bevel_Back_;\nuniform float _Bevel_Back_Stretch_;\nuniform float _Radius_Top_Left_;\nuniform float _Radius_Top_Right_;\nuniform float _Radius_Bottom_Left_;\nuniform float _Radius_Bottom_Right_;\nuniform bool _Bulge_Enabled_;\nuniform float _Bulge_Height_;\nuniform float _Bulge_Radius_;\nuniform float _Sun_Intensity_;\nuniform float _Sun_Theta_;\nuniform float _Sun_Phi_;\nuniform float _Indirect_Diffuse_;\nuniform vec4 _Albedo_;\nuniform float _Specular_;\nuniform float _Shininess_;\nuniform float _Sharpness_;\nuniform float _Subsurface_;\nuniform vec4 _Left_Color_;\nuniform vec4 _Right_Color_;\nuniform float _Reflection_;\nuniform float _Front_Reflect_;\nuniform float _Edge_Reflect_;\nuniform float _Power_;\nuniform vec4 _Sky_Color_;\nuniform vec4 _Horizon_Color_;\nuniform vec4 _Ground_Color_;\nuniform float _Horizon_Power_;\nuniform sampler2D _Reflection_Map_;\nuniform sampler2D _Indirect_Environment_;\nuniform float _Width_;\nuniform float _Fuzz_;\nuniform float _Min_Fuzz_;\nuniform float _Clip_Fade_;\nuniform float _Hue_Shift_;\nuniform float _Saturation_Shift_;\nuniform float _Value_Shift_;\nuniform vec3 _Blob_Position_;\nuniform float _Blob_Intensity_;\nuniform float _Blob_Near_Size_;\nuniform float _Blob_Far_Size_;\nuniform float _Blob_Near_Distance_;\nuniform float _Blob_Far_Distance_;\nuniform float _Blob_Fade_Length_;\nuniform float _Blob_Pulse_;\nuniform float _Blob_Fade_;\nuniform sampler2D _Blob_Texture_;\nuniform vec3 _Blob_Position_2_;\nuniform float _Blob_Near_Size_2_;\nuniform float _Blob_Pulse_2_;\nuniform float _Blob_Fade_2_;\nuniform vec3 _Left_Index_Pos_;\nuniform vec3 _Right_Index_Pos_;\nuniform vec3 _Left_Index_Middle_Pos_;\nuniform vec3 _Right_Index_Middle_Pos_;\nuniform sampler2D _Decal_;\nuniform vec2 _Decal_Scale_XY_;\nuniform bool _Decal_Front_Only_;\nuniform float _Rim_Intensity_;\nuniform sampler2D _Rim_Texture_;\nuniform float _Rim_Hue_Shift_;\nuniform float _Rim_Saturation_Shift_;\nuniform float _Rim_Value_Shift_;\nuniform float _Iridescence_Intensity_;\nuniform sampler2D _Iridescence_Texture_;\nuniform bool Use_Global_Left_Index;\nuniform bool Use_Global_Right_Index;\nuniform vec4 Global_Left_Index_Tip_Position;\nuniform vec4 Global_Right_Index_Tip_Position;\nuniform vec4 Global_Left_Thumb_Tip_Position;\nuniform vec4 Global_Right_Thumb_Tip_Position;\nuniform float Global_Left_Index_Tip_Proximity;\nuniform float Global_Right_Index_Tip_Proximity;\nvarying vec3 vPosition;\nvarying vec3 vNormal;\nvarying vec2 vUV;\nvarying vec3 vTangent;\nvarying vec3 vBinormal;\nvarying vec4 vColor;\nvarying vec4 vExtra1;\nvarying vec4 vExtra2;\nvarying vec4 vExtra3;\nvoid Object_To_World_Pos_B162(\nvec3 Pos_Object,\nout vec3 Pos_World)\n{\nPos_World=(world*vec4(Pos_Object,1.0)).xyz;\n}\nvoid Object_To_World_Normal_B182(\nvec3 Nrm_Object,\nout vec3 Nrm_World)\n{\nNrm_World=(vec4(Nrm_Object,0.0)).xyz;\n}\nvoid Blob_Vertex_B173(\nvec3 Position,\nvec3 Normal,\nvec3 Tangent,\nvec3 Bitangent,\nvec3 Blob_Position,\nfloat Intensity,\nfloat Blob_Near_Size,\nfloat Blob_Far_Size,\nfloat Blob_Near_Distance,\nfloat Blob_Far_Distance,\nfloat Blob_Fade_Length,\nfloat Blob_Pulse,\nfloat Blob_Fade,\nout vec4 Blob_Info)\n{\nvec3 blob= (Use_Global_Left_Index ? Global_Left_Index_Tip_Position.xyz : Blob_Position);\nvec3 delta=blob-Position;\nfloat dist=dot(Normal,delta);\nfloat lerpValue=clamp((abs(dist)-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);\nfloat fadeValue=1.0-clamp((abs(dist)-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);\nfloat size=Blob_Near_Size+(Blob_Far_Size-Blob_Near_Size)*lerpValue;\nvec2 blobXY=vec2(dot(delta,Tangent),dot(delta,Bitangent))/(0.0001+size);\nfloat Fade=fadeValue*Intensity*Blob_Fade;\nfloat Distance=(lerpValue*0.5+0.5)*(1.0-Blob_Pulse);\nBlob_Info=vec4(blobXY.x,blobXY.y,Distance,Fade);\n}\nvoid Blob_Vertex_B174(\nvec3 Position,\nvec3 Normal,\nvec3 Tangent,\nvec3 Bitangent,\nvec3 Blob_Position,\nfloat Intensity,\nfloat Blob_Near_Size,\nfloat Blob_Far_Size,\nfloat Blob_Near_Distance,\nfloat Blob_Far_Distance,\nfloat Blob_Fade_Length,\nfloat Blob_Pulse,\nfloat Blob_Fade,\nout vec4 Blob_Info)\n{\nvec3 blob= (Use_Global_Right_Index ? Global_Right_Index_Tip_Position.xyz : Blob_Position);\nvec3 delta=blob-Position;\nfloat dist=dot(Normal,delta);\nfloat lerpValue=clamp((abs(dist)-Blob_Near_Distance)/(Blob_Far_Distance-Blob_Near_Distance),0.0,1.0);\nfloat fadeValue=1.0-clamp((abs(dist)-Blob_Far_Distance)/Blob_Fade_Length,0.0,1.0);\nfloat size=Blob_Near_Size+(Blob_Far_Size-Blob_Near_Size)*lerpValue;\nvec2 blobXY=vec2(dot(delta,Tangent),dot(delta,Bitangent))/(0.0001+size);\nfloat Fade=fadeValue*Intensity*Blob_Fade;\nfloat Distance=(lerpValue*0.5+0.5)*(1.0-Blob_Pulse);\nBlob_Info=vec4(blobXY.x,blobXY.y,Distance,Fade);\n}\nvoid Move_Verts_B280(\nfloat Anisotropy,\nvec3 P,\nfloat Radius,\nfloat Bevel,\nvec3 Normal_Object,\nfloat ScaleZ,\nfloat Stretch,\nout vec3 New_P,\nout vec2 New_UV,\nout float Radial_Gradient,\nout vec3 Radial_Dir,\nout vec3 New_Normal)\n{\nvec2 UV=P.xy*2.0+0.5;\nvec2 center=clamp(UV,0.0,1.0);\nvec2 delta=UV-center;\nfloat deltad=(length(delta)*2.0);\nfloat f=(Bevel+(Radius-Bevel)*Stretch)/Radius;\nfloat innerd=clamp(deltad*2.0,0.0,1.0);\nfloat outerd=clamp(deltad*2.0-1.0,0.0,1.0);\nfloat bevelAngle=outerd*3.14159*0.5;\nfloat sinb=sin(bevelAngle);\nfloat cosb=cos(bevelAngle);\nfloat beveld=(1.0-f)*innerd+f*sinb;\nfloat br=outerd;\nvec2 r2=2.0*vec2(Radius/Anisotropy,Radius);\nfloat dir=P.z<0.0001 ? 1.0 : -1.0;\nNew_UV=center+r2*((0.5-center)+normalize(delta+vec2(0.0,0.000001))*beveld*0.5);\nNew_P=vec3(New_UV-0.5,P.z+dir*(1.0-cosb)*Bevel*ScaleZ);\nRadial_Gradient=clamp((deltad-0.5)*2.0,0.0,1.0);\nRadial_Dir=vec3(delta*r2,0.0);\nvec3 beveledNormal=cosb*Normal_Object+sinb*vec3(delta.x,delta.y,0.0);\nNew_Normal=Normal_Object.z==0.0 ? Normal_Object : beveledNormal;\n}\nvoid Object_To_World_Dir_B210(\nvec3 Dir_Object,\nout vec3 Normal_World,\nout vec3 Normal_World_N,\nout float Normal_Length)\n{\nNormal_World=(world*vec4(Dir_Object,0.0)).xyz;\nNormal_Length=length(Normal_World);\nNormal_World_N=Normal_World/Normal_Length;\n}\nvoid To_XYZ_B228(\nvec3 Vec3,\nout float X,\nout float Y,\nout float Z)\n{\nX=Vec3.x;\nY=Vec3.y;\nZ=Vec3.z;\n}\nvoid Conditional_Float_B243(\nbool Which,\nfloat If_True,\nfloat If_False,\nout float Result)\n{\nResult=Which ? If_True : If_False;\n}\nvoid Object_To_World_Dir_B178(\nvec3 Dir_Object,\nout vec3 Binormal_World,\nout vec3 Binormal_World_N,\nout float Binormal_Length)\n{\nBinormal_World=(world*vec4(Dir_Object,0.0)).xyz;\nBinormal_Length=length(Binormal_World);\nBinormal_World_N=Binormal_World/Binormal_Length;\n}\nvoid Pick_Radius_B219(\nfloat Radius,\nfloat Radius_Top_Left,\nfloat Radius_Top_Right,\nfloat Radius_Bottom_Left,\nfloat Radius_Bottom_Right,\nvec3 Position,\nout float Result)\n{\nbool whichY=Position.y>0.0;\nResult=Position.x<0.0 ? (whichY ? Radius_Top_Left : Radius_Bottom_Left) : (whichY ? Radius_Top_Right : Radius_Bottom_Right);\nResult*=Radius;\n}\nvoid Conditional_Float_B186(\nbool Which,\nfloat If_True,\nfloat If_False,\nout float Result)\n{\nResult=Which ? If_True : If_False;\n}\nvoid Greater_Than_B187(\nfloat Left,\nfloat Right,\nout bool Not_Greater_Than,\nout bool Greater_Than)\n{\nGreater_Than=Left>Right;\nNot_Greater_Than=!Greater_Than;\n}\nvoid Remap_Range_B255(\nfloat In_Min,\nfloat In_Max,\nfloat Out_Min,\nfloat Out_Max,\nfloat In,\nout float Out)\n{\nOut=mix(Out_Min,Out_Max,clamp((In-In_Min)/(In_Max-In_Min),0.0,1.0));\n}\nvoid main()\n{\nvec2 XY_Q235;\nXY_Q235=(uv-vec2(0.5,0.5))*_Decal_Scale_XY_+vec2(0.5,0.5);\nvec3 Tangent_World_Q177;\nvec3 Tangent_World_N_Q177;\nfloat Tangent_Length_Q177;\nTangent_World_Q177=(world*vec4(vec3(1,0,0),0.0)).xyz;\nTangent_Length_Q177=length(Tangent_World_Q177);\nTangent_World_N_Q177=Tangent_World_Q177/Tangent_Length_Q177;\nvec3 Normal_World_Q210;\nvec3 Normal_World_N_Q210;\nfloat Normal_Length_Q210;\nObject_To_World_Dir_B210(vec3(0,0,1),Normal_World_Q210,Normal_World_N_Q210,Normal_Length_Q210);\nfloat X_Q228;\nfloat Y_Q228;\nfloat Z_Q228;\nTo_XYZ_B228(position,X_Q228,Y_Q228,Z_Q228);\nvec3 Nrm_World_Q176;\nNrm_World_Q176=normalize((world*vec4(normal,0.0)).xyz);\nvec3 Binormal_World_Q178;\nvec3 Binormal_World_N_Q178;\nfloat Binormal_Length_Q178;\nObject_To_World_Dir_B178(vec3(0,1,0),Binormal_World_Q178,Binormal_World_N_Q178,Binormal_Length_Q178);\nfloat Anisotropy_Q179=Tangent_Length_Q177/Binormal_Length_Q178;\nfloat Result_Q219;\nPick_Radius_B219(_Radius_,_Radius_Top_Left_,_Radius_Top_Right_,_Radius_Bottom_Left_,_Radius_Bottom_Right_,position,Result_Q219);\nfloat Anisotropy_Q203=Binormal_Length_Q178/Normal_Length_Q210;\nbool Not_Greater_Than_Q187;\nbool Greater_Than_Q187;\nGreater_Than_B187(Z_Q228,0.0,Not_Greater_Than_Q187,Greater_Than_Q187);\nvec4 Linear_Q251;\nLinear_Q251.rgb=clamp(_Left_Color_.rgb*_Left_Color_.rgb,0.0,1.0);\nLinear_Q251.a=_Left_Color_.a;\nvec4 Linear_Q252;\nLinear_Q252.rgb=clamp(_Right_Color_.rgb*_Right_Color_.rgb,0.0,1.0);\nLinear_Q252.a=_Right_Color_.a;\nvec3 Difference_Q211=vec3(0,0,0)-Normal_World_N_Q210;\nvec4 Out_Color_Q184=vec4(X_Q228,Y_Q228,Z_Q228,1);\nfloat Result_Q186;\nConditional_Float_B186(Greater_Than_Q187,_Bevel_Back_,_Bevel_Front_,Result_Q186);\nfloat Result_Q244;\nConditional_Float_B186(Greater_Than_Q187,_Bevel_Back_Stretch_,_Bevel_Front_Stretch_,Result_Q244);\nvec3 New_P_Q280;\nvec2 New_UV_Q280;\nfloat Radial_Gradient_Q280;\nvec3 Radial_Dir_Q280;\nvec3 New_Normal_Q280;\nMove_Verts_B280(Anisotropy_Q179,position,Result_Q219,Result_Q186,normal,Anisotropy_Q203,Result_Q244,New_P_Q280,New_UV_Q280,Radial_Gradient_Q280,Radial_Dir_Q280,New_Normal_Q280);\nfloat X_Q248;\nfloat Y_Q248;\nX_Q248=New_UV_Q280.x;\nY_Q248=New_UV_Q280.y;\nvec3 Pos_World_Q162;\nObject_To_World_Pos_B162(New_P_Q280,Pos_World_Q162);\nvec3 Nrm_World_Q182;\nObject_To_World_Normal_B182(New_Normal_Q280,Nrm_World_Q182);\nvec4 Blob_Info_Q173;\n#if BLOB_ENABLE\nBlob_Vertex_B173(Pos_World_Q162,Nrm_World_Q176,Tangent_World_N_Q177,Binormal_World_N_Q178,_Blob_Position_,_Blob_Intensity_,_Blob_Near_Size_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_,_Blob_Fade_,Blob_Info_Q173);\n#else\nBlob_Info_Q173=vec4(0,0,0,0);\n#endif\nvec4 Blob_Info_Q174;\n#if BLOB_ENABLE_2\nBlob_Vertex_B174(Pos_World_Q162,Nrm_World_Q176,Tangent_World_N_Q177,Binormal_World_N_Q178,_Blob_Position_2_,_Blob_Intensity_,_Blob_Near_Size_2_,_Blob_Far_Size_,_Blob_Near_Distance_,_Blob_Far_Distance_,_Blob_Fade_Length_,_Blob_Pulse_2_,_Blob_Fade_2_,Blob_Info_Q174);\n#else\nBlob_Info_Q174=vec4(0,0,0,0);\n#endif\nfloat Out_Q255;\nRemap_Range_B255(0.0,1.0,0.0,1.0,X_Q248,Out_Q255);\nfloat X_Q236;\nfloat Y_Q236;\nfloat Z_Q236;\nTo_XYZ_B228(Nrm_World_Q182,X_Q236,Y_Q236,Z_Q236);\nvec4 Color_At_T_Q247=mix(Linear_Q251,Linear_Q252,Out_Q255);\nfloat Minus_F_Q237=-Z_Q236;\nfloat R_Q249;\nfloat G_Q249;\nfloat B_Q249;\nfloat A_Q249;\nR_Q249=Color_At_T_Q247.r; G_Q249=Color_At_T_Q247.g; B_Q249=Color_At_T_Q247.b; A_Q249=Color_At_T_Q247.a;\nfloat ClampF_Q238=clamp(0.0,Minus_F_Q237,1.0);\nfloat Result_Q243;\nConditional_Float_B243(_Decal_Front_Only_,ClampF_Q238,1.0,Result_Q243);\nvec4 Vec4_Q239=vec4(Result_Q243,Radial_Gradient_Q280,G_Q249,B_Q249);\nvec3 Position=Pos_World_Q162;\nvec3 Normal=Nrm_World_Q182;\nvec2 UV=XY_Q235;\nvec3 Tangent=Tangent_World_N_Q177;\nvec3 Binormal=Difference_Q211;\nvec4 Color=Out_Color_Q184;\nvec4 Extra1=Vec4_Q239;\nvec4 Extra2=Blob_Info_Q173;\nvec4 Extra3=Blob_Info_Q174;\ngl_Position=viewProjection*vec4(Position,1);\nvPosition=Position;\nvNormal=Normal;\nvUV=UV;\nvTangent=Tangent;\nvBinormal=Binormal;\nvColor=Color;\nvExtra1=Extra1;\nvExtra2=Extra2;\nvExtra3=Extra3;\n}";
// Sideeffect
core_Engines_shaderStore__WEBPACK_IMPORTED_MODULE_0__.ShaderStore.ShadersStore[name] = shader;
/** @hidden */
var mrdlSliderThumbVertexShader = { name: name, shader: shader };


/***/ }),

/***/ "../../../lts/gui/dist/3D/vector3WithInfo.js":
/*!***************************************************!*\
  !*** ../../../lts/gui/dist/3D/vector3WithInfo.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Vector3WithInfo": () => (/* binding */ Vector3WithInfo)
/* harmony export */ });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../../../node_modules/tslib/tslib.es6.js");
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Maths/math.vector */ "core/Misc/observable");
/* harmony import */ var core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__);


/**
 * Class used to transport Vector3 information for pointer events
 */
var Vector3WithInfo = /** @class */ (function (_super) {
    (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(Vector3WithInfo, _super);
    /**
     * Creates a new Vector3WithInfo
     * @param source defines the vector3 data to transport
     * @param buttonIndex defines the current mouse button index
     */
    function Vector3WithInfo(source, 
    /** defines the current mouse button index */
    buttonIndex) {
        if (buttonIndex === void 0) { buttonIndex = 0; }
        var _this = _super.call(this, source.x, source.y, source.z) || this;
        _this.buttonIndex = buttonIndex;
        return _this;
    }
    return Vector3WithInfo;
}(core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Vector3));



/***/ }),

/***/ "../../../lts/gui/dist/index.js":
/*!**************************************!*\
  !*** ../../../lts/gui/dist/index.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "AbstractButton3D": () => (/* reexport safe */ _3D_index__WEBPACK_IMPORTED_MODULE_1__.AbstractButton3D),
/* harmony export */   "AdvancedDynamicTexture": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.AdvancedDynamicTexture),
/* harmony export */   "AdvancedDynamicTextureInstrumentation": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.AdvancedDynamicTextureInstrumentation),
/* harmony export */   "BaseSlider": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.BaseSlider),
/* harmony export */   "Button": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.Button),
/* harmony export */   "Button3D": () => (/* reexport safe */ _3D_index__WEBPACK_IMPORTED_MODULE_1__.Button3D),
/* harmony export */   "Checkbox": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.Checkbox),
/* harmony export */   "CheckboxGroup": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.CheckboxGroup),
/* harmony export */   "ColorPicker": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.ColorPicker),
/* harmony export */   "Container": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.Container),
/* harmony export */   "Container3D": () => (/* reexport safe */ _3D_index__WEBPACK_IMPORTED_MODULE_1__.Container3D),
/* harmony export */   "Control": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.Control),
/* harmony export */   "Control3D": () => (/* reexport safe */ _3D_index__WEBPACK_IMPORTED_MODULE_1__.Control3D),
/* harmony export */   "CornerHandle": () => (/* reexport safe */ _3D_index__WEBPACK_IMPORTED_MODULE_1__.CornerHandle),
/* harmony export */   "CylinderPanel": () => (/* reexport safe */ _3D_index__WEBPACK_IMPORTED_MODULE_1__.CylinderPanel),
/* harmony export */   "DisplayGrid": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.DisplayGrid),
/* harmony export */   "Ellipse": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.Ellipse),
/* harmony export */   "FluentBackplateMaterial": () => (/* reexport safe */ _3D_index__WEBPACK_IMPORTED_MODULE_1__.FluentBackplateMaterial),
/* harmony export */   "FluentButtonMaterial": () => (/* reexport safe */ _3D_index__WEBPACK_IMPORTED_MODULE_1__.FluentButtonMaterial),
/* harmony export */   "FluentMaterial": () => (/* reexport safe */ _3D_index__WEBPACK_IMPORTED_MODULE_1__.FluentMaterial),
/* harmony export */   "FluentMaterialDefines": () => (/* reexport safe */ _3D_index__WEBPACK_IMPORTED_MODULE_1__.FluentMaterialDefines),
/* harmony export */   "FocusableButton": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.FocusableButton),
/* harmony export */   "GUI3DManager": () => (/* reexport safe */ _3D_index__WEBPACK_IMPORTED_MODULE_1__.GUI3DManager),
/* harmony export */   "GizmoHandle": () => (/* reexport safe */ _3D_index__WEBPACK_IMPORTED_MODULE_1__.GizmoHandle),
/* harmony export */   "Grid": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.Grid),
/* harmony export */   "HandMenu": () => (/* reexport safe */ _3D_index__WEBPACK_IMPORTED_MODULE_1__.HandMenu),
/* harmony export */   "HandleMaterial": () => (/* reexport safe */ _3D_index__WEBPACK_IMPORTED_MODULE_1__.HandleMaterial),
/* harmony export */   "HandleState": () => (/* reexport safe */ _3D_index__WEBPACK_IMPORTED_MODULE_1__.HandleState),
/* harmony export */   "HolographicBackplate": () => (/* reexport safe */ _3D_index__WEBPACK_IMPORTED_MODULE_1__.HolographicBackplate),
/* harmony export */   "HolographicButton": () => (/* reexport safe */ _3D_index__WEBPACK_IMPORTED_MODULE_1__.HolographicButton),
/* harmony export */   "HolographicSlate": () => (/* reexport safe */ _3D_index__WEBPACK_IMPORTED_MODULE_1__.HolographicSlate),
/* harmony export */   "Image": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.Image),
/* harmony export */   "ImageBasedSlider": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.ImageBasedSlider),
/* harmony export */   "ImageScrollBar": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.ImageScrollBar),
/* harmony export */   "InputPassword": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.InputPassword),
/* harmony export */   "InputText": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.InputText),
/* harmony export */   "KeyPropertySet": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.KeyPropertySet),
/* harmony export */   "Line": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.Line),
/* harmony export */   "MRDLBackplateMaterial": () => (/* reexport safe */ _3D_index__WEBPACK_IMPORTED_MODULE_1__.MRDLBackplateMaterial),
/* harmony export */   "MRDLSliderBarMaterial": () => (/* reexport safe */ _3D_index__WEBPACK_IMPORTED_MODULE_1__.MRDLSliderBarMaterial),
/* harmony export */   "MRDLSliderThumbMaterial": () => (/* reexport safe */ _3D_index__WEBPACK_IMPORTED_MODULE_1__.MRDLSliderThumbMaterial),
/* harmony export */   "Matrix2D": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.Matrix2D),
/* harmony export */   "Measure": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.Measure),
/* harmony export */   "MeshButton3D": () => (/* reexport safe */ _3D_index__WEBPACK_IMPORTED_MODULE_1__.MeshButton3D),
/* harmony export */   "MultiLine": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.MultiLine),
/* harmony export */   "MultiLinePoint": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.MultiLinePoint),
/* harmony export */   "NearMenu": () => (/* reexport safe */ _3D_index__WEBPACK_IMPORTED_MODULE_1__.NearMenu),
/* harmony export */   "PlanePanel": () => (/* reexport safe */ _3D_index__WEBPACK_IMPORTED_MODULE_1__.PlanePanel),
/* harmony export */   "RadioButton": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.RadioButton),
/* harmony export */   "RadioGroup": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.RadioGroup),
/* harmony export */   "Rectangle": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.Rectangle),
/* harmony export */   "ScatterPanel": () => (/* reexport safe */ _3D_index__WEBPACK_IMPORTED_MODULE_1__.ScatterPanel),
/* harmony export */   "ScrollBar": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.ScrollBar),
/* harmony export */   "ScrollViewer": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.ScrollViewer),
/* harmony export */   "SelectionPanel": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.SelectionPanel),
/* harmony export */   "SelectorGroup": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.SelectorGroup),
/* harmony export */   "SideHandle": () => (/* reexport safe */ _3D_index__WEBPACK_IMPORTED_MODULE_1__.SideHandle),
/* harmony export */   "SlateGizmo": () => (/* reexport safe */ _3D_index__WEBPACK_IMPORTED_MODULE_1__.SlateGizmo),
/* harmony export */   "Slider": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.Slider),
/* harmony export */   "Slider3D": () => (/* reexport safe */ _3D_index__WEBPACK_IMPORTED_MODULE_1__.Slider3D),
/* harmony export */   "SliderGroup": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.SliderGroup),
/* harmony export */   "SpherePanel": () => (/* reexport safe */ _3D_index__WEBPACK_IMPORTED_MODULE_1__.SpherePanel),
/* harmony export */   "StackPanel": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.StackPanel),
/* harmony export */   "StackPanel3D": () => (/* reexport safe */ _3D_index__WEBPACK_IMPORTED_MODULE_1__.StackPanel3D),
/* harmony export */   "Style": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.Style),
/* harmony export */   "TextBlock": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.TextBlock),
/* harmony export */   "TextWrapper": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.TextWrapper),
/* harmony export */   "TextWrapping": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.TextWrapping),
/* harmony export */   "ToggleButton": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.ToggleButton),
/* harmony export */   "TouchButton3D": () => (/* reexport safe */ _3D_index__WEBPACK_IMPORTED_MODULE_1__.TouchButton3D),
/* harmony export */   "TouchHolographicButton": () => (/* reexport safe */ _3D_index__WEBPACK_IMPORTED_MODULE_1__.TouchHolographicButton),
/* harmony export */   "TouchHolographicMenu": () => (/* reexport safe */ _3D_index__WEBPACK_IMPORTED_MODULE_1__.TouchHolographicMenu),
/* harmony export */   "TouchMeshButton3D": () => (/* reexport safe */ _3D_index__WEBPACK_IMPORTED_MODULE_1__.TouchMeshButton3D),
/* harmony export */   "ValueAndUnit": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.ValueAndUnit),
/* harmony export */   "Vector2WithInfo": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.Vector2WithInfo),
/* harmony export */   "Vector3WithInfo": () => (/* reexport safe */ _3D_index__WEBPACK_IMPORTED_MODULE_1__.Vector3WithInfo),
/* harmony export */   "VirtualKeyboard": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.VirtualKeyboard),
/* harmony export */   "VolumeBasedPanel": () => (/* reexport safe */ _3D_index__WEBPACK_IMPORTED_MODULE_1__.VolumeBasedPanel),
/* harmony export */   "XmlLoader": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.XmlLoader),
/* harmony export */   "name": () => (/* reexport safe */ _2D_index__WEBPACK_IMPORTED_MODULE_0__.name)
/* harmony export */ });
/* harmony import */ var _2D_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./2D/index */ "../../../lts/gui/dist/2D/index.js");
/* harmony import */ var _3D_index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./3D/index */ "../../../lts/gui/dist/3D/index.js");
/* eslint-disable import/no-internal-modules */




/***/ }),

/***/ "../../../lts/gui/dist/legacy/legacy.js":
/*!**********************************************!*\
  !*** ../../../lts/gui/dist/legacy/legacy.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "AbstractButton3D": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.AbstractButton3D),
/* harmony export */   "AdvancedDynamicTexture": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.AdvancedDynamicTexture),
/* harmony export */   "AdvancedDynamicTextureInstrumentation": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.AdvancedDynamicTextureInstrumentation),
/* harmony export */   "BaseSlider": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.BaseSlider),
/* harmony export */   "Button": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.Button),
/* harmony export */   "Button3D": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.Button3D),
/* harmony export */   "Checkbox": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.Checkbox),
/* harmony export */   "CheckboxGroup": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.CheckboxGroup),
/* harmony export */   "ColorPicker": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.ColorPicker),
/* harmony export */   "Container": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.Container),
/* harmony export */   "Container3D": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.Container3D),
/* harmony export */   "Control": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.Control),
/* harmony export */   "Control3D": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.Control3D),
/* harmony export */   "CornerHandle": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.CornerHandle),
/* harmony export */   "CylinderPanel": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.CylinderPanel),
/* harmony export */   "DisplayGrid": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.DisplayGrid),
/* harmony export */   "Ellipse": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.Ellipse),
/* harmony export */   "FluentBackplateMaterial": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.FluentBackplateMaterial),
/* harmony export */   "FluentButtonMaterial": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.FluentButtonMaterial),
/* harmony export */   "FluentMaterial": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.FluentMaterial),
/* harmony export */   "FluentMaterialDefines": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.FluentMaterialDefines),
/* harmony export */   "FocusableButton": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.FocusableButton),
/* harmony export */   "GUI3DManager": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.GUI3DManager),
/* harmony export */   "GizmoHandle": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.GizmoHandle),
/* harmony export */   "Grid": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.Grid),
/* harmony export */   "HandMenu": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.HandMenu),
/* harmony export */   "HandleMaterial": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.HandleMaterial),
/* harmony export */   "HandleState": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.HandleState),
/* harmony export */   "HolographicBackplate": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.HolographicBackplate),
/* harmony export */   "HolographicButton": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.HolographicButton),
/* harmony export */   "HolographicSlate": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.HolographicSlate),
/* harmony export */   "Image": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.Image),
/* harmony export */   "ImageBasedSlider": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.ImageBasedSlider),
/* harmony export */   "ImageScrollBar": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.ImageScrollBar),
/* harmony export */   "InputPassword": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.InputPassword),
/* harmony export */   "InputText": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.InputText),
/* harmony export */   "KeyPropertySet": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.KeyPropertySet),
/* harmony export */   "Line": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.Line),
/* harmony export */   "MRDLBackplateMaterial": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.MRDLBackplateMaterial),
/* harmony export */   "MRDLSliderBarMaterial": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.MRDLSliderBarMaterial),
/* harmony export */   "MRDLSliderThumbMaterial": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.MRDLSliderThumbMaterial),
/* harmony export */   "Matrix2D": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.Matrix2D),
/* harmony export */   "Measure": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.Measure),
/* harmony export */   "MeshButton3D": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.MeshButton3D),
/* harmony export */   "MultiLine": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.MultiLine),
/* harmony export */   "MultiLinePoint": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.MultiLinePoint),
/* harmony export */   "NearMenu": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.NearMenu),
/* harmony export */   "PlanePanel": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.PlanePanel),
/* harmony export */   "RadioButton": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.RadioButton),
/* harmony export */   "RadioGroup": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.RadioGroup),
/* harmony export */   "Rectangle": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.Rectangle),
/* harmony export */   "ScatterPanel": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.ScatterPanel),
/* harmony export */   "ScrollBar": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.ScrollBar),
/* harmony export */   "ScrollViewer": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.ScrollViewer),
/* harmony export */   "SelectionPanel": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.SelectionPanel),
/* harmony export */   "SelectorGroup": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.SelectorGroup),
/* harmony export */   "SideHandle": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.SideHandle),
/* harmony export */   "SlateGizmo": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.SlateGizmo),
/* harmony export */   "Slider": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.Slider),
/* harmony export */   "Slider3D": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.Slider3D),
/* harmony export */   "SliderGroup": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.SliderGroup),
/* harmony export */   "SpherePanel": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.SpherePanel),
/* harmony export */   "StackPanel": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.StackPanel),
/* harmony export */   "StackPanel3D": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.StackPanel3D),
/* harmony export */   "Style": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.Style),
/* harmony export */   "TextBlock": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.TextBlock),
/* harmony export */   "TextWrapper": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.TextWrapper),
/* harmony export */   "TextWrapping": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.TextWrapping),
/* harmony export */   "ToggleButton": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.ToggleButton),
/* harmony export */   "TouchButton3D": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.TouchButton3D),
/* harmony export */   "TouchHolographicButton": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.TouchHolographicButton),
/* harmony export */   "TouchHolographicMenu": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.TouchHolographicMenu),
/* harmony export */   "TouchMeshButton3D": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.TouchMeshButton3D),
/* harmony export */   "ValueAndUnit": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.ValueAndUnit),
/* harmony export */   "Vector2WithInfo": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.Vector2WithInfo),
/* harmony export */   "Vector3WithInfo": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.Vector3WithInfo),
/* harmony export */   "VirtualKeyboard": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.VirtualKeyboard),
/* harmony export */   "VolumeBasedPanel": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.VolumeBasedPanel),
/* harmony export */   "XmlLoader": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.XmlLoader),
/* harmony export */   "name": () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.name)
/* harmony export */ });
/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../index */ "../../../lts/gui/dist/index.js");
/* eslint-disable import/no-internal-modules */

/**
 * Legacy support, defining window.BABYLON.GUI (global variable).
 *
 * This is the entry point for the UMD module.
 * The entry point for a future ESM package should be index.ts
 */
var globalObject = typeof __webpack_require__.g !== "undefined" ? __webpack_require__.g : typeof window !== "undefined" ? window : undefined;
if (typeof globalObject !== "undefined") {
    globalObject.BABYLON = globalObject.BABYLON || {};
    globalObject.BABYLON.GUI = _index__WEBPACK_IMPORTED_MODULE_0__;
}



/***/ }),

/***/ "core/Misc/observable":
/*!****************************************************************************************************!*\
  !*** external {"root":"BABYLON","commonjs":"babylonjs","commonjs2":"babylonjs","amd":"babylonjs"} ***!
  \****************************************************************************************************/
/***/ ((module) => {

module.exports = __WEBPACK_EXTERNAL_MODULE_core_Misc_observable__;

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	(() => {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = (module) => {
/******/ 			var getter = module && module.__esModule ?
/******/ 				() => (module['default']) :
/******/ 				() => (module);
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	(() => {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = (exports, definition) => {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/global */
/******/ 	(() => {
/******/ 		__webpack_require__.g = (function() {
/******/ 			if (typeof globalThis === 'object') return globalThis;
/******/ 			try {
/******/ 				return this || new Function('return this')();
/******/ 			} catch (e) {
/******/ 				if (typeof window === 'object') return window;
/******/ 			}
/******/ 		})();
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	(() => {
/******/ 		__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	(() => {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = (exports) => {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	})();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
(() => {
/*!**********************!*\
  !*** ./src/index.ts ***!
  \**********************/
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   "gui": () => (/* reexport module object */ gui_legacy_legacy__WEBPACK_IMPORTED_MODULE_0__)
/* harmony export */ });
/* harmony import */ var gui_legacy_legacy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gui/legacy/legacy */ "../../../lts/gui/dist/legacy/legacy.js");


/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (gui_legacy_legacy__WEBPACK_IMPORTED_MODULE_0__);

})();

__webpack_exports__ = __webpack_exports__["default"];
/******/ 	return __webpack_exports__;
/******/ })()
;
});
//# sourceMappingURL=babylon.gui.js.map